diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-10 08:52:46 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-11 00:15:03 +0400 |
commit | c782b8ccd740a206bf2b7af393dcade94a38ef7d (patch) | |
tree | 1c9d40a922785b2aa279857a1520a6eb6781bdb7 /core/Registry.php | |
parent | a4972f38678207e649a20f1b5ac281a679bf92fa (diff) |
Refs #4208 refactor all singletons except the hard ones (with custom getInstance()
(some tests failing)
Diffstat (limited to 'core/Registry.php')
-rw-r--r-- | core/Registry.php | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/core/Registry.php b/core/Registry.php index 5fe90370b9..88ecc1ce95 100644 --- a/core/Registry.php +++ b/core/Registry.php @@ -15,24 +15,15 @@ namespace Piwik; * * @package Piwik */ -class Registry +class Registry extends Singleton { - private static $instance; private $data; - private function __construct() + protected function __construct() { $this->data = array(); } - public static function getInstance() - { - if (self::$instance == null) { - self::$instance = new Registry(); - } - return self::$instance; - } - public static function isRegistered($key) { return self::getInstance()->hasKey($key); @@ -48,11 +39,6 @@ class Registry self::getInstance()->setKey($key, $value); } - public static function unsetInstance() - { - self::$instance = null; - } - public function setKey($key, $value) { $this->data[$key] = $value; |