summaryrefslogtreecommitdiffstats
path: root/3rdparty/PEAR5.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-11 17:57:55 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-11 17:57:55 +0200
commit9c2f1051646f1dfb2615065d79d9a76410152b1a (patch)
treeaeb2812f7f37fb58bc6920cd2b3ccdf08d9c1eec /3rdparty/PEAR5.php
parent347ce2aafada161849dad8593100c40e14c641ce (diff)
downloadnextcloud-server-9c2f1051646f1dfb2615065d79d9a76410152b1a.tar.gz
nextcloud-server-9c2f1051646f1dfb2615065d79d9a76410152b1a.zip
update PEAR to 1.9.4
Diffstat (limited to '3rdparty/PEAR5.php')
-rw-r--r--3rdparty/PEAR5.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/3rdparty/PEAR5.php b/3rdparty/PEAR5.php
new file mode 100644
index 00000000000..428606780b7
--- /dev/null
+++ b/3rdparty/PEAR5.php
@@ -0,0 +1,33 @@
+<?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];
+ }
+} \ No newline at end of file