CoreFiles by mySites.guru
PEAR5.php33 lines, 1,087 bytes, from Joomla_1.5.21-Stable-Full_Package.zip
Raw History Compare with 1.5.20
md5
1a8f67d58009372a6cbcddd638b128cf
sha1
e0e5eb31497bf5201b713d8d564799665ed45b2d
sha256
beebebbf40f1b6a0cca86fa1c9049b28c8c8162d7d944cd9a978e8f0b9a426a5
<?php
/**
 * This is only meant for PHP 5 to get rid of certain strict warning
 * that doesn't get hidden since it's in the shutdown function
 */
class PEAR5
{
    /**
    * If you have a class that's mostly/entirely static, and you need static
    * properties, you can use this method to simulate them. Eg. in your method(s)
    * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
    * You MUST use a reference, or they will not persist!
    *
    * @access public
    * @param  string $class  The calling classname, to prevent clashes
    * @param  string $var    The variable to retrieve.
    * @return mixed   A reference to the variable. If not set it will be
    *                 auto initialised to NULL.
    */
    static function &getStaticProperty($class, $var)
    {
        static $properties;
        if (!isset($properties[$class])) {
            $properties[$class] = array();
        }

        if (!array_key_exists($var, $properties[$class])) {
            $properties[$class][$var] = null;
        }

        return $properties[$class][$var];
    }
}

The same content is in 15 releases, Joomla 1.5.12 to 1.5.26. See them all, or every version of this file.