Changeset 6362
- Timestamp:
- 12/07/07 15:34:07 (7 months ago)
- Files:
-
- trunk/lib/cache/sfAPCCache.class.php (modified) (1 diff)
- trunk/lib/cache/sfEAcceleratorCache.class.php (modified) (2 diffs)
- trunk/lib/cache/sfMemcacheCache.class.php (modified) (1 diff)
- trunk/lib/cache/sfXCacheCache.class.php (modified) (2 diffs)
- trunk/test/unit/cache/sfAPCCacheTest.php (modified) (1 diff)
- trunk/test/unit/cache/sfEAcceleratorCacheTest.php (modified) (1 diff)
- trunk/test/unit/cache/sfSQLiteCacheTest.php (modified) (1 diff)
- trunk/test/unit/cache/sfXCacheCacheTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/cache/sfAPCCache.class.php
r4586 r6362 57 57 public function has($key) 58 58 { 59 return false === apc_fetch($this->prefix.$key) ? false : true;59 return !(false === apc_fetch($this->prefix.$key)); 60 60 } 61 61 trunk/lib/cache/sfEAcceleratorCache.class.php
r6361 r6362 57 57 public function has($key) 58 58 { 59 return null === eaccelerator_get($this->prefix.$key) ? false : true;59 return !is_null(eaccelerator_get($this->prefix.$key)); 60 60 } 61 61 … … 102 102 public function clean($mode = sfCache::ALL) 103 103 { 104 if (sfCache::OLD == $mode)104 if (sfCache::OLD === $mode) 105 105 { 106 106 return eaccelerator_gc(); trunk/lib/cache/sfMemcacheCache.class.php
r5223 r6362 103 103 public function has($key) 104 104 { 105 return false === $this->memcache->get($this->prefix.$key) ? false : true;105 return !(false === $this->memcache->get($this->prefix.$key)); 106 106 } 107 107 trunk/lib/cache/sfXCacheCache.class.php
r6215 r6362 64 64 { 65 65 $lifetime = $this->getLifetime($lifetime); 66 66 67 return xcache_set($this->prefix.$key, str_pad(time() + $lifetime, 12, 0, STR_PAD_LEFT).$data, $lifetime); 67 68 } … … 80 81 public function clean($mode = sfCache::ALL) 81 82 { 82 if ($mode != sfCache::ALL)83 if ($mode !== sfCache::ALL) 83 84 { 84 85 return true; trunk/test/unit/cache/sfAPCCacheTest.php
r4957 r6362 14 14 $t = new lime_test($plan, new lime_output_color()); 15 15 16 if (!function_exists('apc_store')) 16 try 17 17 { 18 $t->skip('APC needed to run these tests', $plan); 18 new sfAPCCache(); 19 } 20 catch (sfInitializationException $e) 21 { 22 $t->skip($e->getMessage(), $plan); 19 23 return; 20 24 } trunk/test/unit/cache/sfEAcceleratorCacheTest.php
r6361 r6362 16 16 try 17 17 { 18 $cache =new sfEAcceleratorCache();18 new sfEAcceleratorCache(); 19 19 } 20 20 catch (sfInitializationException $e) 21 21 { 22 22 $t->skip($e->getMessage(), $plan); 23 return; 23 24 } 24 25 trunk/test/unit/cache/sfSQLiteCacheTest.php
r4957 r6362 15 15 $t = new lime_test($plan, new lime_output_color()); 16 16 17 if (!extension_loaded('SQLite')) 17 try 18 18 { 19 $t->skip('APC needed to run these tests', $plan); 19 new sfSQLiteCache(array('database' => ':memory:')); 20 } 21 catch (sfInitializationException $e) 22 { 23 $t->skip($e->getMessage(), $plan); 20 24 return; 21 25 } trunk/test/unit/cache/sfXCacheCacheTest.php
r4957 r6362 14 14 $t = new lime_test($plan, new lime_output_color()); 15 15 16 if (!function_exists('xcache_set')) 16 try 17 17 { 18 $t->skip('XCache needed to run these tests', $plan); 18 new sfXCacheCache(); 19 } 20 catch (sfInitializationException $e) 21 { 22 $t->skip($e->getMessage(), $plan); 19 23 return; 20 24 }