Don't need Horde_Registry::singleton()
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Feb 2010 06:12:44 +0000 (23:12 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Feb 2010 06:12:44 +0000 (23:12 -0700)
40 files changed:
babel/lib/base.php
beatnik/lib/base.php
crumb/lib/base.php
fima/lib/base.php
folks/lib/base.php
framework/Ajax/lib/Horde/Ajax/Imple/Base.php
framework/Auth/lib/Horde/Auth.php
framework/Auth/lib/Horde/Auth/Application.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Registry.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/Scenario.php
framework/Prefs/lib/Horde/Prefs/Ui.php
framework/Text_Filter/lib/Horde/Text/Filter/Emails.php
framework/VFS/lib/VFS/horde.php
horde/po/translation.php
horde/services/cache.php
horde/services/imple.php
horde/templates/index/frames_index.inc
imp/compose-dimp.php
imp/compose-mimp.php
imp/compose.php
imp/lib/Application.php
imp/lib/Auth.php
imp/mailbox-mimp.php
imp/mailbox.php
imp/message-mimp.php
imp/message.php
imp/thread.php
kastalia/download.php
kastalia/lib/base.php
koward/lib/Koward.php
kronolith/lib/Ajax/Imple/Embed.php
news/lib/base.php
skoli/lib/base.php
timeobjects/lib/base.php
vilma/lib/base.php
whups/opensearch.php
whups/scripts/bugzilla-import.php
whups/scripts/obliterate.php
wicked/opensearch.php

index 231f5ba..ace3fff 100644 (file)
@@ -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));
index b22f992..3c07b9d 100644 (file)
@@ -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')));
index a4169f0..a883269 100644 (file)
@@ -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) {
index e3eae34..68337bd 100644 (file)
@@ -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 {
index ae9f7d9..6d399cd 100644 (file)
@@ -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) {
index f284901..0e60bbc 100644 (file)
@@ -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);
     }
 
     /**
index 8eafc40..0ee043f 100644 (file)
@@ -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();
     }
 
     /**
index 6d11fa6..7a23842 100644 (file)
@@ -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));
         }
     }
 
index e74c9f7..851c1cf 100644 (file)
@@ -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));
         }
index 976dedd..4e47287 100644 (file)
@@ -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
index 8592629..70ee55f 100644 (file)
@@ -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();
index ce4c90c..8393099 100644 (file)
@@ -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 '<ul><li>' .
-             Horde::link(Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/services/prefs.php'), array('app' => $app, 'group' => $previous), _("Previous options"))) .
+             Horde::link(Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => $app, 'group' => $previous), _("Previous options"))) .
              '&lt;&lt; ' . $prefGroups[$previous]['label'] .
              '</a>&nbsp;|&nbsp;' .
-             Horde::link(Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/services/prefs.php'), array('app' => $app, 'group' => $next), _("Next options"))) .
+             Horde::link(Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => $app, 'group' => $next), _("Next options"))) .
              $prefGroups[$next]['label'] . ' &gt;&gt;' .
              '</a></li></ul>';
     }
index 77d8399..25551bc 100644 (file)
@@ -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);
         }
index b7d2c63..487d081 100644 (file)
@@ -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."));
     }
 
index 6a61981..0df7212 100755 (executable)
@@ -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]) {
index 39dd9ca..b02c2cd 100644 (file)
@@ -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'];
index 7aaadff..8983470 100644 (file)
@@ -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);
 }
index ec26619..0542dc5 100644 (file)
@@ -1,13 +1,12 @@
 <?php
-$registry = Horde_Registry::singleton();
 $rtl = isset(Horde_Nls::$config['rtl'][$GLOBALS['language']]);
 $sidebar_width = isset($GLOBALS['prefs']) ? $GLOBALS['prefs']->getValue('sidebar_width') : 150;
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd">
 <html>
 <head>
- <link rel="SHORTCUT ICON" href="<?php echo $registry->getImageDir() ?>/favicon.ico" />
- <title><?php echo htmlspecialchars($registry->get('name')) ?></title>
+ <link rel="SHORTCUT ICON" href="<?php echo $GLOBALS['registry']->getImageDir() ?>/favicon.ico" />
+ <title><?php echo htmlspecialchars($GLOBALS['registry']->get('name')) ?></title>
 </head>
 
 <frameset id="hf" cols="<?php echo ($rtl ? '*,' : '') . $sidebar_width . ($rtl ? '' : ',*') ?>" framespacing="0" frameborder="0">
index ed08466..105e756 100644 (file)
@@ -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();
index 712407f..5d50b44 100644 (file)
@@ -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();
index caede20..73db777 100644 (file)
@@ -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();
index 4a6c426..1764571 100644 (file)
@@ -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]));
                     }
index 471c953..abea7c6 100644 (file)
@@ -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;
         }
 
index 924716f..0fc6553 100644 (file)
@@ -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']);
index 53273bc..e238792 100644 (file)
@@ -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 {
index 66bac71..ba88dd7 100644 (file)
@@ -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']);
index af75e9b..55c36fe 100644 (file)
@@ -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
index bb5520d..acb7876 100644 (file)
@@ -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
index 16a657f..9246915 100755 (executable)
@@ -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) {
index f2ed453..abdf387 100644 (file)
@@ -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) {
index 55b87eb..9503f6b 100644 (file)
@@ -52,8 +52,6 @@ class Koward {
     {
         global $registry, $notification, $browser;
 
-        $registry = Horde_Registry::singleton();
-
         $notification = Horde_Notification::singleton();
         $notification->attach('status');
 
index fd0e4c1..438f032 100644 (file)
@@ -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= '';
         }
index e1b10f4..ca74a1d 100644 (file)
@@ -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) {
index 113fc52..3565af8 100644 (file)
@@ -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) {
index 76b6f74..e301d4c 100644 (file)
@@ -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 {
index 827fc4d..50ee587 100644 (file)
@@ -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) {
index 7a5fba9..0c0f965 100644 (file)
@@ -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.
index 060f990..a5b1fd1 100755 (executable)
@@ -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'];
 
index 941547a..4c7c9d1 100755 (executable)
@@ -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'];
 
index c2022ba..6aa878d 100644 (file)
@@ -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.