/** * @param string $namespace * @param bool $singleInstance */ public function __construct($namespace = 'Default', $singleInstance = false) { if (Common::isPhpCliMode()) { self::$_readable = true; return; } Session::start(); parent::__construct($namespace, $singleInstance); }
protected function prepareDispatch($module, $action, $parameters) { if (is_null($module)) { $module = Common::getRequestVar('module', self::DEFAULT_MODULE, 'string'); } if (is_null($action)) { $action = Common::getRequestVar('action', false); } if (SettingsPiwik::isPiwikInstalled() && ($module !== 'API' || $action && $action !== 'index')) { Session::start(); $this->closeSessionEarlyForFasterUI(); } if (is_null($parameters)) { $parameters = array(); } if (!ctype_alnum($module)) { throw new Exception("Invalid module name '{$module}'"); } list($module, $action) = Request::getRenamedModuleAndAction($module, $action); if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated($module)) { throw new PluginDeactivatedException($module); } return array($module, $action, $parameters); }
protected function prepareDispatch($module, $action, $parameters) { if (is_null($module)) { $defaultModule = 'CoreHome'; $module = Common::getRequestVar('module', $defaultModule, 'string'); } if (is_null($action)) { $action = Common::getRequestVar('action', false); } if (!Session::isFileBasedSessions() && ($module !== 'API' || $action && $action !== 'index')) { Session::start(); } if (is_null($parameters)) { $parameters = array(); } if (!ctype_alnum($module)) { throw new Exception("Invalid module name '{$module}'"); } $module = Request::renameModule($module); if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated($module)) { throw new PluginDeactivatedException($module); } return array($module, $action, $parameters); }