Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Renaming unconfig to drop.
  • Loading branch information
markstory committed Nov 15, 2009
1 parent caedbdf commit 70820e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cake/libs/cache.php
Expand Up @@ -133,14 +133,14 @@ function configured() {
}

/**
* 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;
Expand Down
10 changes: 5 additions & 5 deletions cake/tests/cases/libs/cache.test.php
Expand Up @@ -90,8 +90,8 @@ function testConfigWithLibAndPluginEngines() {
$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();
}
Expand Down Expand Up @@ -211,19 +211,19 @@ function testUnconfig() {
'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(
'engine' => 'TestAppCache'
));
$this->assertTrue(Cache::isInitialized('TestAppCache'));

$this->assertTrue(Cache::unconfig('unconfigTest'));
$this->assertTrue(Cache::drop('unconfigTest'));
$this->assertFalse(Cache::isInitialized('TestAppCache'));

Cache::config('tests', $_testsConfig);
Expand Down

0 comments on commit 70820e2

Please sign in to comment.