From: Michael M Slusarz Date: Wed, 3 Feb 2010 22:02:02 +0000 (-0700) Subject: Notification singleton best initialized in Horde_Registry constructor X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1a25ea7e9218d8eedda9ba9cad1d7e68f8f77790;p=horde.git Notification singleton best initialized in Horde_Registry constructor --- diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index c4897f6fc..290f0ea6d 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -309,6 +309,14 @@ class Horde_Registry /* Create the global permissions object. */ // TODO: Convert to using Horde_Injector $GLOBALS['perms'] = Horde_Perms::singleton(); + $injector->setInstance('Horde_Perms', $GLOBALS['perms']); + + /** + * Initialize notification object. + * No listeners are attached at this point. + */ + $GLOBALS['notification'] = Horde_Notification::singleton(); + $injector->setInstance('Horde_Notification', $GLOBALS['notification']); } /** diff --git a/framework/Core/lib/Horde/Registry/Application.php b/framework/Core/lib/Horde/Registry/Application.php index 3f874436a..c5c6446cd 100644 --- a/framework/Core/lib/Horde/Registry/Application.php +++ b/framework/Core/lib/Horde/Registry/Application.php @@ -61,11 +61,6 @@ class Horde_Registry_Application * Initialization. Does any necessary init needed to setup the full * environment for the application. * - * Global variables defined: - *
-     * $notification - Horde_Notification object.
-     * 
- * * Global constants defined: *
      * [APPNAME]_TEMPLATES - (string) Location of template files.
@@ -81,7 +76,6 @@ class Horde_Registry_Application
                 define($appname . '_TEMPLATES', $GLOBALS['registry']->get('templates'));
             }
 
-            $GLOBALS['notification'] = Horde_Notification::singleton();
             $this->_init();
             $this->_initNotification($GLOBALS['notification']);
         }
@@ -97,6 +91,8 @@ class Horde_Registry_Application
 
     /**
      * Initialization for Notification system.
+     * This is run after _init() is called so app-specific code can appear
+     * inside.
      *
      * @param Horde_Notification_Handler_Base $notify  The notification
      *                                                 object.