bootstrap('locale'); setlocale(LC_CTYPE, $this->getResource('locale')->toString() . '.utf-8'); } /** * Set the adapter for the datamapper * * @return void */ protected function _initDataMapper() { $this->bootstrap('db'); App_Model_Mapper_MapperAbstract::setDefaultAdapter( $this->getPluginResource('db')->getDbAdapter() ); } /** * Attach depency injection container * * @return void */ protected function _initServices() { $this->bootstrap('modules'); $this->bootstrap('defaultResourceLoader'); App_Service_ServiceAbstract::attachInjectionContainer( new Default_Service_InjectionContainer(), 'Default_Service_' ); } /** * Setup a resource loader for the default module * * @return void */ protected function _initDefaultResourceLoader() { $resourceLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Default', 'basePath' => dirname(__FILE__) . '/modules/default', )); } /** * Setup additional view parameters * * @return Zend_View */ protected function _initViewEnvironment() { $this->bootstrap('view'); $view = $this->getPluginResource('view')->getView(); $view->doctype(Zend_View_Helper_Doctype::XHTML5); $view->setEncoding('utf-8'); $view->headMeta('', 'utf-8', 'charset') ->headMeta('OvXFW6oQhQx90DlvnS0NNRoGSZl+yeN9khAc8CUiXmg=', 'verify-v1') ->headMeta('mailto+http:sha1:0e3e03684e1a67deb89bfe75f21b1749bba7e1f1', 'microid'); $request = new Zend_Controller_Request_Http(); } /** * Setup DOJO * * @return void */ protected function _initDojo() { $this->bootstrap('view'); $this->bootstrap('frontController'); $front = $this->getResource('frontController'); $view = $this->getResource('view'); $baseUrl = $front->getBaseUrl(); $baseUrl = rtrim($baseUrl, '/'); $localPath = $baseUrl . $this->getOption('dojopath'); if (APPLICATION_ENV === 'production') { $localPath = sprintf($localPath, 'js-' . App_Version::getVersion()); } Zend_Dojo::enableView($view); Zend_Dojo_View_Helper_Dojo::setUseProgrammatic(Zend_Dojo_View_Helper_Dojo::PROGRAMMATIC_NOSCRIPT); $view->dojo()->setLocalPath($localPath) ->registerModulePath('app', '../app') ->requireModule('app.main') ->disable(); } /** * Setup router configuration * * @return Zend_Controller_Router_Rewrite */ protected function _initRouting() { $router = $this->getPluginResource('Router')->getRouter(); $router->removeDefaultRoutes(); return $router; } /** * Set HTTP headers * * @return Zend_Controller_Response_Http */ protected function _initResponse() { $this->bootstrap('frontController'); $response = new Zend_Controller_Response_Http(); $response->setHeader('language', 'en') ->setHeader('content-language', 'en') ->setHeader('Content-Type', 'text/html; charset=utf-8'); $this->getPluginResource('frontController')->getFrontController() ->setResponse($response); return $response; } /** * Set the blowfish secret * * @return void */ public function _initBlowfishSecret() { App_Cookie::setBlowfishSecret($this->getOption('blowfishsecret')); } }