From 2658a934f820cb4e8730a4dc7b21894c8aa8552b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 22 Oct 2010 11:31:36 -0600 Subject: [PATCH] Make the default prefs scope name a class constant --- framework/Prefs/lib/Horde/Prefs.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/framework/Prefs/lib/Horde/Prefs.php b/framework/Prefs/lib/Horde/Prefs.php index 0ab24ca9f..23da1ccab 100644 --- a/framework/Prefs/lib/Horde/Prefs.php +++ b/framework/Prefs/lib/Horde/Prefs.php @@ -23,6 +23,9 @@ class Horde_Prefs implements ArrayAccess * DEFAULT is a reserved PHP constant. */ const IS_DEFAULT = 2; + /* The default scope name. */ + const DEFAULT_SCOPE = 'horde'; + /** * Caching object. * @@ -58,7 +61,7 @@ class Horde_Prefs implements ArrayAccess * * @var string */ - protected $_scope = 'horde'; + protected $_scope = self::DEFAULT_SCOPE; /** * Preferences list. Stored by scope name. Each preference has the @@ -506,9 +509,9 @@ class Horde_Prefs implements ArrayAccess */ protected function _getPrefScope($pref) { - return (isset($this->_scopes[$this->_scope][$pref]) || !isset($this->_scopes['horde'][$pref])) + return (isset($this->_scopes[$this->_scope][$pref]) || !isset($this->_scopes[self::DEFAULT_SCOPE][$pref])) ? $this->_scope - : 'horde'; + : self::DEFAULT_SCOPE; } /** @@ -525,8 +528,8 @@ class Horde_Prefs implements ArrayAccess $this->setScope($scope); } - $this->_loadScope('horde'); - if ($scope != 'horde') { + $this->_loadScope(self::DEFAULT_SCOPE); + if ($scope != self::DEFAULT_SCOPE) { $this->_loadScope($scope); } } -- 2.11.0