Esempio n. 1
0
 public function __construct($opts = array())
 {
     parent::__construct();
     $this->_myConfigs();
     $this->_master = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->configs->mysql->db_master_host, $this->configs->mysql->db_master_dbname), $this->configs->mysql->db_master_user, $this->configs->mysql->db_master_pass, array(PDO::ATTR_PERSISTENT => true));
     $this->_slave = new PDO(sprintf('mysql:host=%s;dbname=%s', $this->configs->mysql->db_slave_host, $this->configs->mysql->db_slave_dbname), $this->configs->mysql->db_slave_user, $this->configs->mysql->db_slave_pass, array(PDO::ATTR_PERSISTENT => true));
     //$this->memcache = new MemcacheConnect();
     //$this->cache = false;
     if (is_array($opts) || is_object($opts)) {
         foreach ($opts as $k => $v) {
             $this->{$k} = $v;
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->_memcache = new Memcache();
     $this->_memcache->connect('localhost', '11211');
 }