Пример #1
0
 public function __construct($siteId)
 {
     $dbAdapter = Zend_Registry::get('dbAdapter');
     $select = $dbAdapter->select();
     $select->from('sites', array('s_dbname', 's_path'));
     $select->where('s_id = ?', $siteId);
     $res = $dbAdapter->fetchRow($select->__toString());
     $this->siteDbName = $res['s_dbname'];
     $config = Zend_Registry::get('config');
     $params = $config->db->config->toArray();
     $params['dbname'] = $this->siteDbName;
     $this->siteDbAdapter = Zend_Db::factory($config->db->adapter, $params);
     $this->siteDbAdapter->query('SET NAMES utf8');
     @IniParser::setIni($res['s_path'] . 'application/config.ini', TRUE);
     $this->constData = new ConstData($params['dbname']);
     $this->headerShort = array('1' => '301 Moved Permanently', '2' => '302 Moved Temporary', '3' => '404 Not Found', '4' => '410 Never exist', '5' => 'No headers');
     $this->headerFull = array('1' => 'HTTP/1.1 301 Moved Permanently', '2' => 'HTTP/1.1 302 Found', '3' => 'HTTP/1.1 404 Not Found', '4' => 'HTTP/1.1 410 Gone', '5' => '');
     $this->id404 = '3';
 }