Example #1
0
 protected function init()
 {
     foreach (self::$classes as $classe) {
         if (self::checkPresence($classe)) {
             // we just need one cache
             self::$cache = new $classe();
             break;
         }
     }
 }
Example #2
0
 public function __construct()
 {
     if (self::$instance !== null) {
         throw new JLD_System_Exception(__CLASS__ . ': only one instance of this class can be created.');
     }
     if (JLD_Cache_Manager::isFake()) {
         throw new JLD_System_Exception(__CLASS__ . ':' . __METHOD__ . ' requires a real cache for performance consideration');
     }
     $this->system_cache = JLD_Cache_Manager::getCache();
     // we must make sure we are initialized!
     $this->init();
     return parent::__construct(self::thisVersion);
 }
Example #3
0
 public function testDeleteExistingKey()
 {
     $o = JLD_Cache_Manager::singleton();
     $c = $o->getCache();
     $c->delete('key5');
     $c->add('key5', 'value5');
     $c->delete('key5');
     $r = $c->get('key5');
     $this->assertEquals(false, $r);
 }
Example #4
0
 protected static function updateCache()
 {
     $cache = JLD_Cache_Manager::getCache();
     $key = self::getCacheKey(self::thisCacheKeyVar);
     $cache->set($key, self::$cList, self::$expiry);
 }