Exemple #1
0
 /**
  * Session GC (垃圾回收) handler.
  * 不要直接调用该方法。
  * @param integer $maxLifetime session的有效时间。
  * @return boolean 
  */
 public function gcSession($maxLifetime)
 {
     $this->db->createCommand(sprintf('delete from %s where expire<:expire', $this->sessionTable), array('expire' => time()))->exec();
     return true;
 }
Exemple #2
0
 /**
  * 获取数据库连接实例
  * @return \PDO
  */
 public function getPdoInstance()
 {
     return $this->lastPdoInstance = ConnectionPool::pdo($this->getToken());
 }