Ejemplo n.º 1
0
 public function gc($expires = null)
 {
     if (!empty($this->cacheKey)) {
         Cache::gc($this->cacheKey);
     }
     return parent::gc($expires);
 }
Ejemplo n.º 2
0
 /**
  * Method called on close of a database session.
  *
  * @return boolean Success
  * @access private
  */
 public function close()
 {
     $probability = mt_rand(1, 150);
     if ($probability <= 3) {
         DatabaseSession::gc();
     }
     return true;
 }
 /**
  * test the garbage collector
  *
  * @return void
  */
 public function testGc()
 {
     ClassRegistry::flush();
     Configure::write('Session.timeout', 0);
     $storage = new DatabaseSession();
     $storage->write('foo', 'Some value');
     sleep(1);
     $storage->gc();
     $this->assertSame($storage->read('foo'), '');
 }
Ejemplo n.º 4
0
 /**
  * @param null $expires
  * @return bool
  */
 public function gc($expires = null)
 {
     return Cache::gc($this->cacheKey) && parent::gc($expires);
 }
Ejemplo n.º 5
0
 public function save($object)
 {
     $this->databaseSession->executeNoResult(new SaveQuery($this->getTableName(), $object));
 }