public function __construct() { $this->_db = Zend_Registry::get('db'); $this->_config = Zend_Registry::get('config'); $this->_cSelect = Engine_Db::instance(); $this->_cSelect->setTags(array()); }
private function _initDatabase() { try { $this->_db = Zend_Db::factory($this->_config->database); Zend_Db_Table_Abstract::setDefaultAdapter($this->_db); /* do bazy danych bez domyślnego połączenia w trybie utf8 */ $this->_db->query('SET NAMES utf8'); } catch (Exception $e) { if ($this->_config->mode == ' staging') { throw $e; } else { die($e); } } Zend_Registry::set('db', $this->_db); $cSelect = Engine_Db::instance(); if ($this->_config->mode == 'staging') { $cSelect->setTimeout(0); } }