Skip to content

Instantly share code, notes, and snippets.

<?php
class JVersionCompatibility
{
/**
* Class constructor.
*
* @param SimpleXmlElement $node The compatibility node from a manifest file.
*
* @see https://github.com/joomla/joomla-cms/issues/598 for XML specification.
*/
// PHP < 5.3.6
foreach (debug_backtrace() as $trace)
{
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']);
}
die;
// PHP >= 5.3.6
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
die;

PSR-1 PHP Code Style Standard

Version: 1 2012-05-??

This standard comprises the code style requirements for interoperability (Section 1) and the best practices guidelines (Section 2) for PHP projects.

O Definitions

studly-caps refers to a naming convention where all 'words' in the name are conactenated and have only the first letter in uppercase followed by lower case letters (for example "StudlyCaps").

/**
* Import a CSV file.
*
* @param string $fileName The name of the file to import. If omitted, the state is used.
* @param integer $offset The number of lines/rows to ignore (default = 0).
*
* @return void
*
* @since 1.0
* @throws InvalidArgumentException if file name is invalid or does not exist.
<?php
/**
* @package Joomla.Platform
* @subpackage Database
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
<?php
/**
* @package Joomla.UnitTest
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
/**
* Reflection helper class.
<?php
/**
* @package Joomla.UnitTest
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
/**
* Reflection helper class.
class JHtmlDHDate
{
/**
* Outputs a relative time.
*
* @param mixed $date A string or DateTime object representing the time in the past to compare to now.
*
* @return string
*
* @since 1.0.1
@beingsane
beingsane / 01.js
Last active August 29, 2015 14:20 — forked from martinaglv/01.js
function whatDoesItDo(val){
return val ? 1 : 2;
}
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage: