Ejemplo n.º 1
0
 function updateCheck()
 {
     Piwik_UpdateCheck::check();
 }
Ejemplo n.º 2
0
 /**
  * Must be called before dispatch()
  * - checks that directories are writable,
  * - loads the configuration file,
  * - loads the plugin, 
  * - inits the DB connection,
  * - etc.
  * 
  * @return void 
  */
 function init()
 {
     try {
         Zend_Registry::set('timer', new Piwik_Timer());
         $directoriesToCheck = array('/tmp', '/tmp/templates_c', '/tmp/cache');
         Piwik::checkDirectoriesWritableOrDie($directoriesToCheck);
         self::assignCliParametersToRequest();
         $exceptionToThrow = false;
         try {
             Piwik::createConfigObject();
         } catch (Exception $e) {
             Piwik_PostEvent('FrontController.NoConfigurationFile', $e);
             $exceptionToThrow = $e;
         }
         Piwik_Translate::getInstance()->loadEnglishTranslation();
         $pluginsManager = Piwik_PluginsManager::getInstance();
         $pluginsManager->setPluginsToLoad(Zend_Registry::get('config')->Plugins->Plugins->toArray());
         if ($exceptionToThrow) {
             throw $exceptionToThrow;
         }
         Piwik::createDatabaseObject();
         Piwik::createLogObject();
         // creating the access object, so that core/Updates/* can enforce Super User and use some APIs
         Piwik::createAccessObject();
         Piwik::displayScreenForCoreAndPluginsUpdatesIfNecessary();
         Piwik_PluginsManager::getInstance()->installLoadedPlugins();
         Piwik::install();
         Piwik_PostEvent('FrontController.initAuthenticationObject');
         try {
             $authAdapter = Zend_Registry::get('auth');
         } catch (Exception $e) {
             throw new Exception("Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?\n\t\t\t\t\t\t\t\t\t<br>You can activate the plugin by adding:<br>\n\t\t\t\t\t\t\t\t\t<code>Plugins[] = Login</code><br>\n\t\t\t\t\t\t\t\t\tunder the <code>[Plugins]</code> section in your config/config.inc.php");
         }
         Zend_Registry::get('access')->reloadAccess($authAdapter);
         Piwik::raiseMemoryLimitIfNecessary();
         Piwik_Translate::getInstance()->loadUserTranslation();
         $pluginsManager->setLanguageToLoad(Piwik_Translate::getInstance()->getLanguageToLoad());
         $pluginsManager->postLoadPlugins();
         Piwik_UpdateCheck::check();
     } catch (Exception $e) {
         Piwik_ExitWithMessage($e->getMessage(), $e->getTraceAsString(), true);
     }
 }