1
0
This repository has been archived on 2025-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
archives
bundled-libs
Cache
HTTP
Net
Onyx
PEAR
Smarty
Text
XML
composer
docs
katzgrau
psr
simplepie
tests
zendframework
.current_version
PEAR.php
PEAR5.php
autoload.php
create_release.sh
serendipity_generateFTPChecksums.php
deployment
docs
htmlarea
include
lang
plugins
sql
templates
templates_c
tests
uploads
.gitignore
README.markdown
checksums.inc.php
comment.php
composer.json
composer.phar
exit.php
index.php
rss.php
serendipity.css.php
serendipity_admin.php
serendipity_admin_image_selector.php
serendipity_config.inc.php
serendipity_xmlrpc.php
wfwcomment.php
LuckyCoinkydink/bundled-libs/PEAR5.php
2015-01-10 17:51:08 +01:00

33 lines
1.1 KiB
PHP

<?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];
}
}