From e73c134898000aa83c9b5fbf815e9829adcbbd3e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 2 Feb 2010 23:12:44 -0700 Subject: [PATCH] Don't need Horde_Registry::singleton() --- babel/lib/base.php | 2 +- beatnik/lib/base.php | 2 +- crumb/lib/base.php | 2 +- fima/lib/base.php | 6 ++-- folks/lib/base.php | 2 +- framework/Ajax/lib/Horde/Ajax/Imple/Base.php | 3 +- framework/Auth/lib/Horde/Auth.php | 15 ++++------ framework/Auth/lib/Horde/Auth/Application.php | 34 +++++++--------------- framework/Core/lib/Horde.php | 7 ++--- framework/Core/lib/Horde/Registry.php | 33 +++++++-------------- .../test/Horde/Kolab/Storage/Scenario.php | 2 +- framework/Prefs/lib/Horde/Prefs/Ui.php | 6 ++-- .../Text_Filter/lib/Horde/Text/Filter/Emails.php | 13 ++------- framework/VFS/lib/VFS/horde.php | 33 +-------------------- horde/po/translation.php | 2 +- horde/services/cache.php | 1 - horde/services/imple.php | 1 - horde/templates/index/frames_index.inc | 5 ++-- imp/compose-dimp.php | 4 ++- imp/compose-mimp.php | 4 ++- imp/compose.php | 4 ++- imp/lib/Application.php | 13 +++------ imp/lib/Auth.php | 7 ++--- imp/mailbox-mimp.php | 4 ++- imp/mailbox.php | 4 ++- imp/message-mimp.php | 4 ++- imp/message.php | 4 ++- imp/thread.php | 4 ++- kastalia/download.php | 2 +- kastalia/lib/base.php | 2 +- koward/lib/Koward.php | 2 -- kronolith/lib/Ajax/Imple/Embed.php | 16 ++++------ news/lib/base.php | 2 +- skoli/lib/base.php | 2 +- timeobjects/lib/base.php | 6 ++-- vilma/lib/base.php | 2 +- whups/opensearch.php | 2 +- whups/scripts/bugzilla-import.php | 2 +- whups/scripts/obliterate.php | 2 +- wicked/opensearch.php | 2 +- 40 files changed, 97 insertions(+), 166 deletions(-) diff --git a/babel/lib/base.php b/babel/lib/base.php index 231f5babc..ace3fff28 100644 --- a/babel/lib/base.php +++ b/babel/lib/base.php @@ -27,7 +27,7 @@ $notification = Horde_Notification::singleton(); $notification->attach('status'); /* Registry. */ -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('babel', array('logintasks' => true)); diff --git a/beatnik/lib/base.php b/beatnik/lib/base.php index b22f99220..3c07b9d39 100644 --- a/beatnik/lib/base.php +++ b/beatnik/lib/base.php @@ -20,7 +20,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('beatnik', array('check_perms' => (Horde_Util::nonInputVar('beatnik_authentication') != 'none'))); diff --git a/crumb/lib/base.php b/crumb/lib/base.php index a4169f0fb..a88326995 100644 --- a/crumb/lib/base.php +++ b/crumb/lib/base.php @@ -20,7 +20,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('crumb', array('logintasks' => true)); } catch (Horde_Exception $e) { diff --git a/fima/lib/base.php b/fima/lib/base.php index e3eae34bd..68337bd8c 100644 --- a/fima/lib/base.php +++ b/fima/lib/base.php @@ -18,11 +18,11 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $session_control = Horde_Util::nonInputVar('session_control'); if ($session_control == 'none') { - $registry = Horde_Registry::singleton(HORDE_SESSION_NONE); + $registry = new Horde_Registry(HORDE_SESSION_NONE); } elseif ($session_control == 'readonly') { - $registry = Horde_Registry::singleton(HORDE_SESSION_READONLY); + $registry = new Horde_Registry(HORDE_SESSION_READONLY); } else { - $registry = Horde_Registry::singleton(); + $registry = new Horde_Registry(); } try { diff --git a/folks/lib/base.php b/folks/lib/base.php index ae9f7d9c5..6d399cd03 100644 --- a/folks/lib/base.php +++ b/folks/lib/base.php @@ -17,7 +17,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('folks', array('check_perms' => (Horde_Util::nonInputVar('folks_authentication') != 'none'))); } catch (Horde_Exception $e) { diff --git a/framework/Ajax/lib/Horde/Ajax/Imple/Base.php b/framework/Ajax/lib/Horde/Ajax/Imple/Base.php index f28490112..0e60bbc9d 100644 --- a/framework/Ajax/lib/Horde/Ajax/Imple/Base.php +++ b/framework/Ajax/lib/Horde/Ajax/Imple/Base.php @@ -62,8 +62,7 @@ abstract class Horde_Ajax_Imple_Base $qstring .= '/' . $key . '=' . rawurlencode($val); } - $registry = Horde_Registry::singleton(); - return Horde::url($registry->get('webroot', 'horde') . '/services/imple.php?' . $qstring, $full); + return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/imple.php?' . $qstring, $full); } /** diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index 8eafc407c..0ee043fd0 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -352,11 +352,10 @@ class Horde_Auth static public function removeUserData($userId) { $errApps = array(); - $registry = Horde_Registry::singleton(); - foreach ($registry->listApps(array('notoolbar', 'hidden', 'active', 'admin')) as $app) { + foreach ($GLOBALS['registry']->listApps(array('notoolbar', 'hidden', 'active', 'admin')) as $app) { try { - $registry->callByPackage($app, 'removeUserData', array($userId)); + $GLOBALS['registry']->callByPackage($app, 'removeUserData', array($userId)); } catch (Horde_Auth_Exception $e) { Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR); $errApps[] = $app; @@ -543,8 +542,6 @@ class Horde_Auth */ static public function getLogoutUrl($options = array()) { - $registry = Horde_Registry::singleton(); - if (!isset($options['reason'])) { $options['reason'] = self::getAuthError(); } @@ -575,7 +572,7 @@ class Horde_Auth } } - return Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/login.php', true), $params, null, false); + return Horde::getServiceLink('login', 'horde')->add($params)->setRaw(true); } /** @@ -748,8 +745,7 @@ class Horde_Auth ); /* Reload preferences for the new user. */ - $registry = Horde_Registry::singleton(); - $registry->loadPrefs(); + $GLOBALS['registry']->loadPrefs(); Horde_Nls::setLang($GLOBALS['prefs']->getValue('language')); if (!empty($options['nologin'])) { @@ -807,8 +803,7 @@ class Horde_Auth unset($_SESSION['horde_auth']); /* Remove the user's cached preferences if they are present. */ - $registry = Horde_Registry::singleton(); - $registry->unloadPrefs(); + $GLOBALS['registry']->unloadPrefs(); } /** diff --git a/framework/Auth/lib/Horde/Auth/Application.php b/framework/Auth/lib/Horde/Auth/Application.php index 6d11fa68d..7a2384249 100644 --- a/framework/Auth/lib/Horde/Auth/Application.php +++ b/framework/Auth/lib/Horde/Auth/Application.php @@ -72,8 +72,7 @@ class Horde_Auth_Application extends Horde_Auth_Base if (!in_array($capability, $this->_loaded) && isset($this->_apiMethods[$capability])) { - $registry = Horde_Registry::singleton(); - $this->_capabilities[$capability] = $registry->hasAppMethod($this->_app, $this->_apiMethods[$capability]); + $this->_capabilities[$capability] = $GLOBALS['registry']->hasAppMethod($this->_app, $this->_apiMethods[$capability]); $this->_loaded[] = $capability; } @@ -118,12 +117,10 @@ class Horde_Auth_Application extends Horde_Auth_Base throw new Horde_Auth_Exception($this->_app . ' does not provide an authenticate() method.'); } - $registry = Horde_Registry::singleton(); - $credentials['auth_ob'] = $this; try { - $result = $registry->callAppMethod($this->_app, $this->_apiMethods['authenticate'], array('args' => array($userId, $credentials), 'noperms' => true)); + $result = $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['authenticate'], array('args' => array($userId, $credentials), 'noperms' => true)); } catch (Horde_Auth_Exception $e) { throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN); } @@ -138,8 +135,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function listUsers() { if ($this->hasCapability('list')) { - $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['list']); + return $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['list']); } else { return parent::listUsers(); } @@ -155,8 +151,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function exists($userId) { if ($this->hasCapability('exists')) { - $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['exists'], array('args' => array($userId))); + return $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['exists'], array('args' => array($userId))); } else { return parent::exists($userId); } @@ -173,8 +168,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function addUser($userId, $credentials) { if ($this->hasCapability('add')) { - $registry = Horde_Registry::singleton(); - $registry->callAppMethod($this->_app, $this->_apiMethods['add'], array('args' => array($userId, $credentials))); + $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['add'], array('args' => array($userId, $credentials))); } else { parent::addUser($userId, $credentials); } @@ -192,8 +186,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function updateUser($oldID, $newID, $credentials) { if ($this->hasCapability('update')) { - $registry = Horde_Registry::singleton(); - $registry->callAppMethod($this->_app, $this->_apiMethods['update'], array('args' => array($oldID, $newID, $credentials))); + $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['update'], array('args' => array($oldID, $newID, $credentials))); } else { parent::updateUser($userId, $credentials); } @@ -211,8 +204,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function resetPassword($userId) { if ($this->hasCapability('resetpassword')) { - $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['resetpassword'], array('args' => array($userId))); + return $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['resetpassword'], array('args' => array($userId))); } return parent::resetPassword(); @@ -228,8 +220,7 @@ class Horde_Auth_Application extends Horde_Auth_Base public function removeUser($userId) { if ($this->hasCapability('remove')) { - $registry = Horde_Registry::singleton(); - $registry->callAppMethod($this->_app, $this->_apiMethods['remove'], array('args' => array($userId))); + $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['remove'], array('args' => array($userId))); Horde_Auth::removeUserData($userId); } else { parent::removeUser($userId); @@ -270,8 +261,7 @@ class Horde_Auth_Application extends Horde_Auth_Base !$this->hasCapability('authenticate')); } - $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['transparent'], array('args' => array($this), 'noperms' => true)); + return $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['transparent'], array('args' => array($this), 'noperms' => true)); } /** @@ -309,8 +299,7 @@ class Horde_Auth_Application extends Horde_Auth_Base return parent::getLoginParams(); } - $registry = Horde_Registry::singleton(); - return $registry->callAppMethod($this->_app, $this->_apiMethods['loginparams'], array('noperms' => true)); + return $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['loginparams'], array('noperms' => true)); } /** @@ -369,8 +358,7 @@ class Horde_Auth_Application extends Horde_Auth_Base protected function _authCallback() { if ($this->hasCapability('authenticatecallback')) { - $registry = Horde_Registry::singleton(); - $registry->callAppMethod($this->_app, $this->_apiMethods['authenticatecallback'], array('noperms' => true)); + $GLOBALS['registry']->callAppMethod($this->_app, $this->_apiMethods['authenticatecallback'], array('noperms' => true)); } } diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index e74c9f736..851c1cf8b 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -1710,8 +1710,8 @@ HTML; switch ($cache_type) { case 'filesystem': $css_filename = '/static/' . $sig . '.css'; - $css_path = $GLOBALS['registry']->get('fileroot', 'horde') . $css_filename; - $css_url = $GLOBALS['registry']->get('webroot', 'horde') . $css_filename; + $css_path = $registry->get('fileroot', 'horde') . $css_filename; + $css_url = $registry->get('webroot', 'horde') . $css_filename; $exists = file_exists($css_path); break; @@ -2229,8 +2229,7 @@ HTML; */ static public function getCacheUrl($type, $params = array()) { - $registry = Horde_Registry::singleton(); - $url = Horde_Util::addParameter(self::getserviceLink('cache', 'horde'), array('cache' => $type)); + $url = self::getserviceLink('cache', 'horde')->add('cache', $type); foreach ($params as $key => $val) { $url .= '/' . $key . '=' . rawurlencode(strval($val)); } diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 976dedd18..4e4728709 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -124,6 +124,11 @@ class Horde_Registry */ static public function appInit($app, $args = array()) { + if (isset($GLOBALS['registry'])) { + $this->init(); + return $GLOBALS['registry']->getApiInstance($app, 'application'); + } + $args = array_merge(array( 'admin' => false, 'authentication' => null, @@ -166,7 +171,9 @@ class Horde_Registry break; } - $GLOBALS['registry'] = self::singleton($s_ctrl); + $classname = __CLASS__; + $GLOBALS['registry'] = new $classname($s_ctrl); + $appob = $GLOBALS['registry']->getApiInstance($app, 'application'); $appob->initParams = $args; @@ -200,27 +207,6 @@ class Horde_Registry } /** - * Returns a reference to the global Horde_Registry object, only creating - * it if it doesn't already exist. - * - * This method must be invoked as: - * $registry = Horde_Registry::singleton() - * - * @param integer $session_flags Any session flags. - * - * @return Horde_Registry The Horde_Registry instance. - * @throws Horde_Exception - */ - static public function singleton($session_flags = 0) - { - if (!isset(self::$_instance)) { - self::$_instance = new self($session_flags); - } - - return self::$_instance; - } - - /** * Create a new Horde_Registry instance. * * @param integer $session_flags Any session flags. @@ -242,8 +228,11 @@ class Horde_Registry $injector->addBinder('Horde_Template', new Horde_Core_Binder_Template()); $injector->addBinder('Net_DNS_Resolver', new Horde_Core_Binder_Dns()); + $injector->setInstance('Horde_Registry', $this); + /* Initialize browser object. */ $GLOBALS['browser'] = Horde_Browser::singleton(); + $injector->setInstance('Horde_Browser', $GLOBALS['browser']); /* Import and global Horde's configuration values. Almost a chicken * and egg issue - since loadConfiguration() uses registry in certain diff --git a/framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php b/framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php index 8592629a1..70ee55f1c 100644 --- a/framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php +++ b/framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php @@ -317,7 +317,7 @@ EOD; } /** Provide the horde registry */ - $GLOBALS['registry'] = Horde_Registry::singleton(); + $GLOBALS['registry'] = new Horde_Registry(); $GLOBALS['notification'] = Horde_Notification::singleton(); $this->prepareFixedConfiguration(); diff --git a/framework/Prefs/lib/Horde/Prefs/Ui.php b/framework/Prefs/lib/Horde/Prefs/Ui.php index ce4c90c87..839309914 100644 --- a/framework/Prefs/lib/Horde/Prefs/Ui.php +++ b/framework/Prefs/lib/Horde/Prefs/Ui.php @@ -363,8 +363,6 @@ class Horde_Prefs_Ui */ static public function generateNavigationCell($app, $group) { - $registry = Horde_Registry::singleton(); - // Search for previous and next groups. $first = $last = $next = $previous = null; $finish = $found = false; @@ -403,10 +401,10 @@ class Horde_Prefs_Ui } echo ''; } diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php b/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php index 77d839911..25551bc29 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php @@ -73,12 +73,8 @@ class Horde_Text_Filter_Emails extends Horde_Text_Filter /eix EOR; - if (class_exists('Horde_Registry')) { - $registry = Horde_Registry::singleton(); - } - - if (isset($registry) && - $registry->hasMethod('mail/compose') && + if (isset($GLOBALS['registry']) && + $GLOBALS['registry']->hasMethod('mail/compose') && !$this->_params['always_mailto']) { /* If we have a mail/compose registry method, use it. */ $replacement = 'Horde_Text_Filter_Emails::callback(\'registry\', \'' @@ -136,10 +132,7 @@ EOP; parse_str($args, $extra); try { - $registry = Horde_Registry::singleton(); - $url = $registry->call('mail/compose', - array(array('to' => $email), - $extra)); + $url = $GLOBALS['registry']->call('mail/compose', array(array('to' => $email), $extra)); } catch (Horde_Exception $e) { $url = 'mailto:' . urlencode($email); } diff --git a/framework/VFS/lib/VFS/horde.php b/framework/VFS/lib/VFS/horde.php index b7d2c631e..487d0814d 100644 --- a/framework/VFS/lib/VFS/horde.php +++ b/framework/VFS/lib/VFS/horde.php @@ -43,7 +43,7 @@ class VFS_horde extends VFS { Horde_Registry::appInit('horde'); // Create the Registry object. - $this->_registry = Horde_Registry::singleton(); + $this->_registry = $GLOBALS['registry']; } function _connect() @@ -67,9 +67,6 @@ class VFS_horde extends VFS { */ function size($path, $name) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -85,10 +82,6 @@ class VFS_horde extends VFS { */ function read($path, $name) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } - if (substr($path, 0, 1) == '/') { $path = substr($path, 1); } @@ -118,9 +111,6 @@ class VFS_horde extends VFS { */ function write($path, $name, $tmpFile, $autocreate = false) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -138,9 +128,6 @@ class VFS_horde extends VFS { */ function writeData($path, $name, $data, $autocreate = false) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -157,9 +144,6 @@ class VFS_horde extends VFS { */ function move($path, $name, $dest) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -176,9 +160,6 @@ class VFS_horde extends VFS { */ function copy($path, $name, $dest) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -194,9 +175,6 @@ class VFS_horde extends VFS { */ function deleteFile($path, $name) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -214,9 +192,6 @@ class VFS_horde extends VFS { */ function rename($oldpath, $oldname, $newpath, $newname) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } @@ -235,9 +210,6 @@ class VFS_horde extends VFS { function _listFolder($path, $filter = null, $dotfiles = true, $dironly = false) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } $list = array(); if ($path == '/') { $apps = $this->_registry->listApps(null, false, Horde_Perms::READ); @@ -320,9 +292,6 @@ class VFS_horde extends VFS { */ function listFolders($path = '', $filter = null, $dotfolders = true) { - if (is_a($this->_registry, 'PEAR_Error')) { - return $this->_registry; - } return PEAR::raiseError(_("Not supported.")); } diff --git a/horde/po/translation.php b/horde/po/translation.php index 6a61981ae..0df7212b4 100755 --- a/horde/po/translation.php +++ b/horde/po/translation.php @@ -630,7 +630,7 @@ function init() $lang = getenv('LANG'); } - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_NONE); + $registry = new Horde_Registry(Horde_Registry::SESSION_NONE); for ($i = 0; $i < count($dirs); $i++) { if (!empty($module) && $module != $apps[$i]) { diff --git a/horde/services/cache.php b/horde/services/cache.php index 39dd9cae1..b02c2cdab 100644 --- a/horde/services/cache.php +++ b/horde/services/cache.php @@ -47,7 +47,6 @@ case 'app': if (empty($args['app'])) { exit; } - $registry = Horde_Registry::singleton(); try { $result = $registry->callAppMethod($args['app'], 'cacheOutput', array('args' => array($args))); $data = $result['data']; diff --git a/horde/services/imple.php b/horde/services/imple.php index 7aaadffd0..8983470bc 100644 --- a/horde/services/imple.php +++ b/horde/services/imple.php @@ -61,7 +61,6 @@ Horde_Registry::appInit('horde', array('nologintasks' => true, 'session_control' $impleargs = $impleName; if (isset($args['impleApp'])) { - $registry = Horde_Registry::singleton(); $registry->pushApp($args['impleApp']); $impleargs = array($args['impleApp'], $impleName); } diff --git a/horde/templates/index/frames_index.inc b/horde/templates/index/frames_index.inc index ec2661904..0542dc514 100644 --- a/horde/templates/index/frames_index.inc +++ b/horde/templates/index/frames_index.inc @@ -1,13 +1,12 @@ getValue('sidebar_width') : 150; ?> - - <?php echo htmlspecialchars($registry->get('name')) ?> + + <?php echo htmlspecialchars($GLOBALS['registry']->get('name')) ?> diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index ed0846614..105e756b4 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -28,7 +28,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* Determine if compose mode is disabled. */ $compose_disable = !IMP::canCompose(); diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 712407f24..5d50b4456 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -13,7 +13,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* The message text and headers. */ $expand = array(); diff --git a/imp/compose.php b/imp/compose.php index caede20fb..73db77790 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -13,7 +13,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('session_control' => 'netscape', 'tz' => true)); +Horde_Registry::appInit('imp', array('session_control' => 'netscape')); + +Horde_Nls::setTimeZone(); /* The message headers and text. */ $header = array(); diff --git a/imp/lib/Application.php b/imp/lib/Application.php index 4a6c42655..176457160 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -97,10 +97,6 @@ class IMP_Application extends Horde_Registry_Application */ protected function _init() { - if (!empty($this->initParams['tz'])) { - Horde_Nls::setTimeZone(); - } - $GLOBALS['injector']->addBinder('IMP_Imap_Tree', new IMP_Injector_Binder_Imaptree()); // Initialize global $imp_imap object. @@ -893,8 +889,7 @@ class IMP_Application extends Horde_Registry_Application { self::$prefsCache['sourceselect'] = array(); - $registry = Horde_Registry::singleton(); - if (!$registry->hasMethod('contacts/sources') || + if (!$GLOBALS['registry']->hasMethod('contacts/sources') || $GLOBALS['prefs']->isLocked('search_sources')) { return; } @@ -902,11 +897,11 @@ class IMP_Application extends Horde_Registry_Application $readable = $search_fields = $prefSelect = $writeable = $writeSelect = array(); try { - $readable = $registry->call('contacts/sources'); + $readable = $GLOBALS['registry']->call('contacts/sources'); } catch (Horde_Exception $e) {} try { - $writeable = $registry->call('contacts/sources', array(true)); + $writeable = $GLOBALS['registry']->call('contacts/sources', array(true)); } catch (Horde_Exception $e) {} $search = IMP_Compose::getAddressSearchParams(); @@ -940,7 +935,7 @@ class IMP_Application extends Horde_Registry_Application $search_fields[$source_count][] = $source; try { - foreach ($registry->call('contacts/fields', array($source)) as $field) { + foreach ($GLOBALS['registry']->call('contacts/fields', array($source)) as $field) { if ($field['search']) { $search_fields[$source_count][] = array($field['name'], $field['label'], isset($search['fields'][$source]) && in_array($field['name'], $search['fields'][$source])); } diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index 471c95320..abea7c61a 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -431,22 +431,21 @@ class IMP_Auth $sess['file_upload'] = $GLOBALS['browser']->allowFileUploads(); /* Is the 'mail/canApplyFilters' API call available? */ - $registry = Horde_Registry::singleton(); try { - if ($registry->call('mail/canApplyFilters')) { + if ($GLOBALS['registry']->call('mail/canApplyFilters')) { $sess['filteravail'] = true; } } catch (Horde_Exception $e) {} /* Is the 'tasks/listTasklists' call available? */ if ($conf['tasklist']['use_tasklist'] && - $registry->hasMethod('tasks/listTasklists')) { + $GLOBALS['registry']->hasMethod('tasks/listTasklists')) { $sess['tasklistavail'] = true; } /* Is the 'notes/listNotepads' call available? */ if ($conf['notepad']['use_notepad'] && - $registry->hasMethod('notes/listNotepads')) { + $GLOBALS['registry']->hasMethod('notes/listNotepads')) { $sess['notepadavail'] = true; } diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php index 924716feb..0fc65535c 100644 --- a/imp/mailbox-mimp.php +++ b/imp/mailbox-mimp.php @@ -21,7 +21,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* Determine if mailbox is readonly. */ $readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']); diff --git a/imp/mailbox.php b/imp/mailbox.php index 53273bc81..e238792a1 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -39,7 +39,9 @@ function _outputSummaries($msgs) require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* Call the mailbox redirection hook, if requested. */ try { diff --git a/imp/message-mimp.php b/imp/message-mimp.php index 66bac71da..ba88dd72d 100644 --- a/imp/message-mimp.php +++ b/imp/message-mimp.php @@ -19,7 +19,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* Make sure we have a valid index. */ $imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['uid'] . IMP::IDX_SEP . $imp_mbox['thismailbox']); diff --git a/imp/message.php b/imp/message.php index af75e9b2b..55c36fe52 100644 --- a/imp/message.php +++ b/imp/message.php @@ -20,7 +20,9 @@ function _returnToMailbox($startIndex = null, $actID = null) } require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* We know we are going to be exclusively dealing with this mailbox, so * select it on the IMAP server (saves some STATUS calls). Open R/W to clear diff --git a/imp/thread.php b/imp/thread.php index bb5520de8..acb787694 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -10,7 +10,9 @@ */ require_once dirname(__FILE__) . '/lib/Application.php'; -Horde_Registry::appInit('imp', array('tz' => true)); +Horde_Registry::appInit('imp'); + +Horde_Nls::setTimeZone(); /* What mode are we in? * DEFAULT/'thread' - Thread mode diff --git a/kastalia/download.php b/kastalia/download.php index 16a657fd6..92469156c 100755 --- a/kastalia/download.php +++ b/kastalia/download.php @@ -30,7 +30,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php index f2ed453a7..abdf3870f 100644 --- a/kastalia/lib/base.php +++ b/kastalia/lib/base.php @@ -20,7 +20,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { diff --git a/koward/lib/Koward.php b/koward/lib/Koward.php index 55b87ebdc..9503f6b9e 100644 --- a/koward/lib/Koward.php +++ b/koward/lib/Koward.php @@ -52,8 +52,6 @@ class Koward { { global $registry, $notification, $browser; - $registry = Horde_Registry::singleton(); - $notification = Horde_Notification::singleton(); $notification->attach('status'); diff --git a/kronolith/lib/Ajax/Imple/Embed.php b/kronolith/lib/Ajax/Imple/Embed.php index fd0e4c1c8..438f03270 100644 --- a/kronolith/lib/Ajax/Imple/Embed.php +++ b/kronolith/lib/Ajax/Imple/Embed.php @@ -62,10 +62,6 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base $nocss = true; } - /* Load the registry with no session control */ - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_NONE); - - /* Build the block parameters */ $params = array( 'calendar' => $calendar, @@ -75,24 +71,24 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base ); /* Call the Horde_Block api to get the calendar HTML */ - $title = $registry->call('horde/blockTitle', array('kronolith', $view, $params)); - $results = $registry->call('horde/blockContent', array('kronolith', $view, $params)); + $title = $GLOBALS['registry']->call('horde/blockTitle', array('kronolith', $view, $params)); + $results = $GLOBALS['registry']->call('horde/blockContent', array('kronolith', $view, $params)); /* Some needed paths */ - $js_path = $registry->get('jsuri', 'kronolith'); + $js_path = $GLOBALS['registry']->get('jsuri', 'kronolith'); /* Local js */ $jsurl = Horde::url($js_path . '/embed.js', true); /* Horde's js */ - $hjs_path = $registry->get('jsuri', 'horde'); + $hjs_path = $GLOBALS['registry']->get('jsuri', 'horde'); $hjsurl = Horde::url($hjs_path . '/tooltips.js', true); $pturl = Horde::url($hjs_path . '/prototype.js', true); /* CSS */ if (empty($nocss)) { - $cssurl = Horde::url($registry->get('themesuri', 'kronolith') . '/embed.css', true); - $hcssurl = Horde::url($registry->get('themesuri', 'horde') . '/embed.css', true); + $cssurl = Horde::url($GLOBALS['registry']->get('themesuri', 'kronolith') . '/embed.css', true); + $hcssurl = Horde::url($GLOBALS['registry']->get('themesuri', 'horde') . '/embed.css', true); } else { $cssurl= ''; } diff --git a/news/lib/base.php b/news/lib/base.php index e1b10f495..ca74a1d7a 100644 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -23,7 +23,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('news', array('check_perms' => (Horde_Util::nonInputVar('news_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { diff --git a/skoli/lib/base.php b/skoli/lib/base.php index 113fc5262..3565af822 100644 --- a/skoli/lib/base.php +++ b/skoli/lib/base.php @@ -16,7 +16,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('skoli', array('check_perms' => (Horde_Util::nonInputVar('skoli_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { diff --git a/timeobjects/lib/base.php b/timeobjects/lib/base.php index 76b6f74be..e301d4cf8 100644 --- a/timeobjects/lib/base.php +++ b/timeobjects/lib/base.php @@ -25,11 +25,11 @@ require_once HORDE_BASE . '/lib/core.php'; /* Registry. */ $session_control = Horde_Util::nonInputVar('session_control'); if ($session_control == 'none') { - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_NONE); + $registry = new Horde_Registry(Horde_Registry::SESSION_NONE); } elseif ($session_control == 'readonly') { - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_READONLY); + $registry = new Horde_Registry(Horde_Registry::SESSION_READONLY); } else { - $registry = Horde_Registry::singleton(); + $registry = new Horde_Registry(); } try { diff --git a/vilma/lib/base.php b/vilma/lib/base.php index 827fc4de2..50ee587af 100644 --- a/vilma/lib/base.php +++ b/vilma/lib/base.php @@ -20,7 +20,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; /* Registry. */ -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); try { $registry->pushApp('vilma', !defined('AUTH_HANDLER')); } catch (Horde_Exception $e) { diff --git a/whups/opensearch.php b/whups/opensearch.php index 7a5fba957..0c0f9659d 100644 --- a/whups/opensearch.php +++ b/whups/opensearch.php @@ -18,7 +18,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); $registry->pushApp('whups'); // Url. diff --git a/whups/scripts/bugzilla-import.php b/whups/scripts/bugzilla-import.php index 060f99051..a5b1fd1e3 100755 --- a/whups/scripts/bugzilla-import.php +++ b/whups/scripts/bugzilla-import.php @@ -36,7 +36,7 @@ $cli =& Horde_Cli::singleton(); /* Load the Whups libraries. */ require_once HORDE_BASE . '/lib/core.php'; -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); $registry->pushApp('whups', false); $conf = &$GLOBALS['conf']; diff --git a/whups/scripts/obliterate.php b/whups/scripts/obliterate.php index 941547a3a..4c7c9d1b4 100755 --- a/whups/scripts/obliterate.php +++ b/whups/scripts/obliterate.php @@ -35,7 +35,7 @@ if ($confirm !== 'y') { /* Load the Whups libraries. */ require_once HORDE_BASE . '/lib/core.php'; -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); $registry->pushApp('whups', false); $conf = &$GLOBALS['conf']; diff --git a/wicked/opensearch.php b/wicked/opensearch.php index c2022ba9b..6aa878d9e 100644 --- a/wicked/opensearch.php +++ b/wicked/opensearch.php @@ -18,7 +18,7 @@ if (!defined('HORDE_BASE')) { require_once HORDE_BASE . '/lib/core.php'; // Registry. -$registry = Horde_Registry::singleton(); +$registry = new Horde_Registry(); $registry->pushApp('wicked'); // Url. -- 2.11.0