fix application initialization
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 17 May 2010 18:34:53 +0000 (14:34 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 17 May 2010 18:34:53 +0000 (14:34 -0400)
mnemo/index.php
mnemo/lib/Application.php
mnemo/lib/Mnemo.php

index e4ae074..96893e9 100644 (file)
  * @since   Mnemo 1.0
  * @package Mnemo
  */
-
-@define('MNEMO_BASE', dirname(__FILE__));
-$mnemo_configured = (is_readable(MNEMO_BASE . '/config/conf.php') &&
-                     is_readable(MNEMO_BASE . '/config/prefs.php'));
-
-if (!$mnemo_configured) {
-    require MNEMO_BASE . '/../lib/Test.php';
-    Horde_Test::configFilesMissing('Mnemo', MNEMO_BASE, array('conf.php', 'prefs.php'));
-}
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('mnemo');
 
 require MNEMO_BASE . '/list.php';
index da9e126..bad8565 100644 (file)
@@ -49,12 +49,6 @@ class Mnemo_Application extends Horde_Registry_Application
      */
     protected function _init()
     {
-        // Set the timezone variable.
-        Horde_Nls::setTimeZone();
-
-        // Create a share instance.
-        $GLOBALS['mnemo_shares'] = Horde_Share::singleton($GLOBALS['registry']->getApp());
-
         Mnemo::initialize();
     }
 
index d81d82b..94bbc68 100644 (file)
@@ -402,6 +402,8 @@ class Mnemo {
      */
     public static function initialize()
     {
+        $GLOBALS['mnemo_shares'] = Horde_Share::singleton($GLOBALS['injector']->getInstance('Horde_Registry')->getApp());
+
         // Update the preference for which notepads to display. If the
         // user doesn't have any selected notepads for view then fall
         // back to some available notepad.