databaseConfigExists ()) { throw new Exception_BadInstallation ('Database configurations does not exist.'); } parent::__construct(); $this->defineExceptionHandler (); $this->defineSimpleConstants (); $this->defineDatabasedConstants (); Zend_Registry::getInstance()->Environment = new Environment_Runtime(); $affiliate_program = new Affiliate_Program (); $affiliate_program->register (); Zend_Registry::set ('affiliate-program', $affiliate_program); } protected function onBeforeRender () { if (! defined ('WHERE_WE_NOW')) { $this->currentLocationIs ($this->view_name); } Event::run ('controller.render', $this); } function not_found () { $this->currentLocationIs ('userpage'); $page404 = ORM::factory('page')->getSystemPage(Page_Model::SYSTEM_PAGE_NOT_FOUND)->find(); if ($page404->exists ()) { $this->view_name = 'user_page'; $page = new Theme_Page (); $page->setMacrophage (new Theme_Macrophage ()); $page->setRecord ($page404); $this->view->page = $page; header (sprintf ('%s 404 Not Found' , $_SERVER ['SERVER_PROTOCOL'])); } else { throw new Exception_BadInstallation(Exception_BadInstallation::E_404_PAGE_DOESNOT_EXIST); } } }