diff options
Diffstat (limited to 'core/FrontController.php')
-rw-r--r-- | core/FrontController.php | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index 22c99c84b2..9d691d4421 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -10,6 +10,9 @@ * @package Piwik */ +// no direct access +defined('PIWIK_INCLUDE_PATH') or die; + /** * @see core/PluginsManager.php * @see core/Translate.php @@ -105,7 +108,7 @@ class Piwik_FrontController if(!class_exists($controllerClassName, false)) { $moduleController = PIWIK_INCLUDE_PATH . '/plugins/' . $module . '/Controller.php'; - if(!is_readable($moduleController)) + if( !Zend_Loader::isReadable($moduleController)) { throw new Exception("Module controller $moduleController not found!"); } @@ -160,14 +163,13 @@ class Piwik_FrontController try { Piwik::printSqlProfilingReportZend(); Piwik::printQueryCount(); -/* - if(Piwik::getModule() !== 'API') - { - Piwik::printMemoryUsage(); - Piwik::printTimer(); - } - */ } catch(Exception $e) {} + + if(Piwik::getModule() !== 'API') + { +// Piwik::printMemoryUsage(); +// Piwik::printTimer(); + } } /** @@ -204,21 +206,16 @@ class Piwik_FrontController } $pluginsManager = Piwik_PluginsManager::getInstance(); - $pluginsManager->loadPlugins( Zend_Registry::get('config')->Plugins->Plugins->toArray() ); + $pluginsManager->setPluginsToLoad( Zend_Registry::get('config')->Plugins->Plugins->toArray() ); if($exceptionToThrow) { throw $exceptionToThrow; } + Piwik_Translate::getInstance()->loadUserTranslation(); - try { - Piwik::createDatabaseObject(); - } catch(Exception $e) { - Piwik_PostEvent('FrontController.badConfigurationFile', $e); - throw $e; - } - + Piwik::createDatabaseObject(); Piwik::createLogObject(); // creating the access object, so that core/Updates/* can enforce Super User and use some APIs @@ -233,18 +230,16 @@ class Piwik_FrontController $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? - <br />You can activate the plugin by adding:<br /> - <code>Plugins[] = Login</code><br /> + <br>You can activate the plugin by adding:<br> + <code>Plugins[] = Login</code><br> under the <code>[Plugins]</code> section in your config/config.inc.php"); } Zend_Registry::get('access')->reloadAccess($authAdapter); - Piwik_Translate::getInstance()->loadUserTranslation(); Piwik::raiseMemoryLimitIfNecessary(); $pluginsManager->setLanguageToLoad( Piwik_Translate::getInstance()->getLanguageToLoad() ); - $pluginsManager->loadTranslations(); $pluginsManager->postLoadPlugins(); Piwik_PostEvent('FrontController.checkForUpdates'); |