/** * Do some initialization for page process * Could be called by some class which need do page process manually * @see Hush_App_Dispatcher * @return unknown */ public function __init() { // page execute time $this->start_time = microtime(true); // set page debug object $this->_debug = Hush_Debug::getInstance(); $this->_debug->setWriter(new Hush_Debug_Writer_Html()); // close debug infos in www if (!strcmp(__ENV, 'www')) { $this->_debug->setDebugLevel(Hush_Debug::INFO); } }
/** * Do some initialization for page process * Could be called by some class which need do page process manually * @see Hush_App_Dispatcher * @return unknown */ public function __prepare() { // page execute time if (Hush_Debug::showDebug('time')) { $this->start_time = microtime(true); } // insert callback method $this->__before_prepare(); // set page debug object $this->_debug = Hush_Debug::getInstance(); $this->_debug->addWriter(new Hush_Debug_Writer_Html()); // close debug infos in www if (!strcmp(__ENV, 'www')) { $this->_debug->setDebugLevel(Hush_Debug::INFO); } // set page tpl object $view_engine = defined('__TPL_ENGINE') ? __TPL_ENGINE : 'Smarty'; $this->view = Hush_View::getInstance($view_engine, array('template_dir' => $this->tplDir . DIRECTORY_SEPARATOR . 'template', 'compile_dir' => $this->tplDir . DIRECTORY_SEPARATOR . 'template_c', 'config_dir' => $this->tplDir . DIRECTORY_SEPARATOR . 'config', 'cache_dir' => $this->tplDir . DIRECTORY_SEPARATOR . 'cache')); // insert callback method $this->__before_process(); }