diff --git a/cake/libs/cache.php b/cake/libs/cache.php index b674bd390..7f47a7edb 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -414,12 +414,6 @@ class Cache { * @return boolean True if the cache was succesfully cleared, false otherwise */ public static function clear($check = false, $config = 'default') { - $settings = self::settings($config); - - if (empty($settings)) { - return null; - } - if (!self::isInitialized($config)) { return false; } diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index eac2fce8a..653e87c4f 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -106,7 +106,7 @@ class ApcEngine extends CacheEngine { } /** - * Delete all keys from the cache + * Delete all keys from the cache. This will clear every cache config using APC. * * @return boolean True if the cache was succesfully cleared, false otherwise */ diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 9d2e81f08..dfd86e47f 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -193,4 +193,17 @@ class ApcEngineTest extends CakeTestCase { $result = Cache::read('test_increment', 'apc'); $this->assertEqual(8, $result); } + +/** + * test the clearing of cache keys + * + * @return void + */ + function testClear() { + Cache::write('some_value', 'value', 'apc'); + + $result = Cache::clear(false, 'apc'); + $this->assertTrue($result); + $this->assertFalse(Cache::read('some_value', 'apc')); + } }