protected function afterAction($action) { $time = sprintf('%0.5f', Yii::getLogger()->getExecutionTime()); $memory = round(memory_get_peak_usage() / (1024 * 1024), 2) . "MB"; echo "Time: {$time}, memory: {$memory}"; parent::afterAction($action); }
protected function afterAction($action) { parent::afterAction($action); // echo 'after'; if ($this->_conf['cache_page_status'] == 'open') { $cacheTime = $this->_conf['cache_page_time']; $cacheId = $this->_thisUrl; ob_start(); $pageData = ob_get_contents(); if (Yii::app()->cache->set($cacheId, $pageData, $cacheTime)) { //记录 echo '写入cache'; CacheData::_addMycache('页面缓存', $cacheId, $cacheTime, $this->_thisUrl); } } }
/** * This method is invoked right after an action is executed. * You may override this method to do some postprocessing for the action. * @param CAction $action the action just executed. */ protected function afterAction($action) { return parent::afterAction($action); }
/** * After action * * Save the current cycle,progra, and application */ public function afterAction() { if ($this->_program) { $this->_store->currentProgramId = $this->_program->getId(); } if ($this->_cycle) { $this->_store->currentCycleId = $this->_cycle->getId(); } parent::afterAction(); }