function __construct()
 {
     $this->yaf = \ImReworks\Yaf::getInstance();
     $this->db = $this->yaf->db;
     $this->db->connect();
     $this->dbs = new \Swoole\SelectDB($this->db);
 }
Exemple #2
0
 /**
  * 检查连接状态,如果连接断开,则重新连接
  */
 function check_status()
 {
     if (!$this->_db->ping()) {
         $this->_db->close();
         $this->_db->connect();
     }
 }