/** * Загрузка профайлера базы данных * * @return void */ protected function setProfiler() { if ($this->_cnf['resources']['db']['params']['profiler']) { $profiler = $this->_boot->getResource('Db')->getProfiler(); $this->view->assign('SqlTotal', $profiler->getTotalElapsedSecs()); $this->view->assign('SqlQueries', $profiler->getTotalNumQueries()); //print_r($profiler); } }
/** * Конструктор модели * @param null|\Zend_Application_Bootstrap_Bootstrap $bootstrap */ public function __construct(Zend_Application_Bootstrap_Bootstrap $bootstrap = null) { if ($bootstrap instanceof Zend_Application_Bootstrap_Bootstrap) { $this->_boot = $bootstrap; } else { $this->_boot = Zend_Controller_Front::getInstance()->getParam('bootstrap'); } $this->_cnf = $this->_boot->getOptions(); $this->_request = $this->_boot->getResource('Request'); $this->_params = $this->_request->getParams(); $this->_usersession = $this->_boot->getResource('UserSession'); $this->_db = $this->_boot->getResource('Db'); $this->_translate = $this->_boot->getResource('Translate'); if (isset($this->_params['module'])) { $this->setModule($this->_params['module']); } if (method_exists($this, 'init')) { $this->init(); } }