Renaming unconfig to drop.

This commit is contained in:
mark_story 2009-11-14 20:18:58 -05:00
parent caedbdf98a
commit 70820e2e96
2 changed files with 7 additions and 7 deletions

View file

@ -133,14 +133,14 @@ class Cache {
}
/**
* Unconfigures a cache engine. Deletes the cache configuration information
* Drops a cache engine. Deletes the cache configuration information
* If the deleted configuration is the last configuration using an certain engine,
* the Engine instance is also unset.
*
* @param string $name A currently configured cache config you wish to remove.
* @return boolen success of the removal, returns false when the config does not exist.
**/
function unconfig($name) {
function drop($name) {
$_this = Cache::getInstance();
if (!isset($_this->__config[$name])) {
return false;

View file

@ -90,8 +90,8 @@ class CacheTest extends CakeTestCase {
$result = Cache::config('pluginLibEngine', $settings);
$this->assertEqual($result, Cache::config('pluginLibEngine'));
Cache::unconfig('libEngine');
Cache::unconfig('pluginLibEngine');
Cache::drop('libEngine');
Cache::drop('pluginLibEngine');
App::build();
}
@ -211,11 +211,11 @@ class CacheTest extends CakeTestCase {
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$result = Cache::unconfig('some_config_that_does_not_exist');
$result = Cache::drop('some_config_that_does_not_exist');
$this->assertFalse($result);
$_testsConfig = Cache::config('tests');
$result = Cache::unconfig('tests');
$result = Cache::drop('tests');
$this->assertTrue($result);
Cache::config('unconfigTest', array(
@ -223,7 +223,7 @@ class CacheTest extends CakeTestCase {
));
$this->assertTrue(Cache::isInitialized('TestAppCache'));
$this->assertTrue(Cache::unconfig('unconfigTest'));
$this->assertTrue(Cache::drop('unconfigTest'));
$this->assertFalse(Cache::isInitialized('TestAppCache'));
Cache::config('tests', $_testsConfig);