Example #1
0
 public function setUp()
 {
     if (!extension_loaded('redis')) {
         $this->markTestSkipped('The Redis extension was not loaded.');
     }
     $this->cache = \fluxbb\cache\Cache::load('Redis', array());
 }
Example #2
0
 public function setUp()
 {
     if (!extension_loaded('wincache')) {
         $this->markTestSkipped('The WinCache extension was not loaded.');
     }
     $this->cache = \fluxbb\cache\Cache::load('WinCache', array());
 }
Example #3
0
 public function setUp()
 {
     if (!extension_loaded('zendcache')) {
         $this->markTestSkipped('The ZendCache extension was not loaded.');
     }
     $this->cache = \fluxbb\cache\Cache::load('ZendSHM', array());
 }
Example #4
0
 public function setUp()
 {
     if (!extension_loaded('eaccelerator') || !function_exists('eaccelerator_put')) {
         $this->markTestSkipped('The eAccelerator extension was not loaded.');
     }
     $this->cache = \fluxbb\cache\Cache::load('eAccelerator', array());
 }
Example #5
0
 public function setUp()
 {
     if (!extension_loaded('memcached')) {
         $this->markTestSkipped('The Memcached extension was not loaded.');
     }
     $this->cache = \fluxbb\cache\Cache::load('Memcached', array());
 }
Example #6
0
 public function get($key)
 {
     $data = parent::get($key);
     if ($data === self::NOT_FOUND) {
         return self::NOT_FOUND;
     }
     // Check if the data has expired
     if ($data['expire'] > 0 && $data['expire'] < time()) {
         $this->delete($key);
         // Correct the hit/miss counts
         $this->hits--;
         $this->misses++;
         return self::NOT_FOUND;
     }
     return $data['data'];
 }
Example #7
0
 public function setUp()
 {
     $this->cache = \fluxbb\cache\Cache::load('File', array('dir' => '/tmp/fluxbb-cache'));
 }