From 0a01dee4c8af9192d8110115a8988635157493e9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 20 Nov 2009 11:51:59 -0700 Subject: [PATCH] Store static in class, not function --- imp/lib/Folder.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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; } /** -- 2.11.0