예제 #1
0
 public function testFlush()
 {
     $pool = new ehough_stash_Pool();
     $pool->setDriver(new ehough_stash_test_stub_DriverExceptionStub());
     $item = $pool->getItem('test');
     $this->assertFalse($item->isDisabled());
     $this->assertFalse($pool->flush());
     $item = $pool->getItem('test');
     $this->assertTrue($item->isDisabled(), 'Is disabled after exception is thrown in driver');
     $this->assertFalse($pool->flush());
 }
예제 #2
0
 /**
  * This function is defined by the SessionHandlerInterface and is for PHP's
  * internal use. It is called randomly based on the session.gc_divisor,
  * session.gc_probability and session.gc_lifetime settings, which should be
  * set according to the drivers used. Those with built in eviction
  * mechanisms will not need this functionality, while those without it will.
  * It is also possible to disable the built in garbage collection (place
  * gc_probability as zero) and call the "purge" function on the ehough_stash_Pool
  * class directly.
  *
  * @param  int  $maxlifetime
  * @return bool
  */
 public function gc($maxlifetime)
 {
     return $this->pool->purge();
 }