From: Michael M Slusarz Date: Fri, 20 Nov 2009 18:51:59 +0000 (-0700) Subject: Store static in class, not function X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0a01dee4c8af9192d8110115a8988635157493e9;p=horde.git Store static in class, not function --- diff --git a/imp/lib/Folder.php b/imp/lib/Folder.php index af08155d1..df9fdeba7 100644 --- a/imp/lib/Folder.php +++ b/imp/lib/Folder.php @@ -18,6 +18,13 @@ class IMP_Folder { /** + * Singleton instance. + * + * @var IMP_Folder + */ + static protected $_instance = null; + + /** * Keep around identical lists so that we don't hit the server more that * once in the same page for the same thing. * @@ -41,13 +48,11 @@ class IMP_Folder */ static public function singleton() { - static $folder; - - if (!isset($folder)) { - $folder = new IMP_Folder(); + if (is_null(self::$_instance)) { + self::$_instance = new IMP_Folder(); } - return $folder; + return self::$_instance; } /**