コード例 #1
0
ファイル: Bootstrap.php プロジェクト: KasaiDot/FansubCMS
 /**
  * init application
  * @return void
  */
 protected function _initApplication()
 {
     Zend_Session::setOptions(array('name' => $this->settings->page->session->name, 'save_path' => realpath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sessions')));
     Zend_Session::start();
     // sollte wenn name feststeht ge�ndert werden
     # get an instance of the frontend controller
     $this->bootstrap('FrontController');
     $this->frontController = Zend_Controller_Front::getInstance();
     # now add our own dispatcher
     $this->frontController->setDispatcher(new FansubCMS_Controller_Dispatcher_Standard());
     # prefix default module as well
     $this->frontController->setParam('prefixDefaultModule', true);
     # set default and module controller directrories
     //  $this->frontController->setControllerDirectory($this->settings->controllers->toArray());
     $this->frontController->addModuleDirectory(APPLICATION_PATH . "/modules");
     $this->frontController->removeControllerDirectory('default');
     # set default module
     $this->frontController->setDefaultModule("news");
     # Init application-wide Session
     $applicationSessionNamespace = new Zend_Session_Namespace('application');
     $applicationSessionNamespace->tstamp = !isset($applicationSessionNamespace->tstamp) ? time() : $applicationSessionNamespace->tstamp;
     # add it to the registry
     Zend_Registry::set('applicationSessionNamespace', $applicationSessionNamespace);
     # Init authentication Session
     $authSessionNamespace = new Zend_Session_Namespace('Zend_Auth');
     # add it to the registry
     Zend_Registry::set('AuthSessionNamespace', $authSessionNamespace);
     # set timezone
     date_default_timezone_set(empty($this->settings->page->timezone) ? 'Europe/Berlin' : $this->settings->page->timezone);
     # hook to settings
     $this->settings->applicationStatus = $this->applicationStatus;
     # hook needed objects/values to the zend registry
     Zend_Registry::set('settings', $this->settings);
     Zend_Registry::set('applicationStatus', $this->applicationStatus);
     Zend_Registry::set('environmentSettings', $this->environmentsettings);
     Zend_Registry::set('emailSettings', $this->mailsettings);
 }