mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge branch '1.3' into 1.3-misc
This commit is contained in:
commit
b68d2a32bf
3 changed files with 8 additions and 7 deletions
|
@ -54,6 +54,6 @@
|
|||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $cakeDebug; ?>
|
||||
<?php echo $this->element('sql_dump'); ?>
|
||||
</body>
|
||||
</html>
|
|
@ -119,8 +119,8 @@ class Cache {
|
|||
return false;
|
||||
}
|
||||
|
||||
$self->__name = $name;
|
||||
$engine = $self->__config[$name]['engine'];
|
||||
$self->__name = $name;
|
||||
|
||||
if (!isset($self->_engines[$name])) {
|
||||
$self->_buildEngine($name);
|
||||
|
@ -218,10 +218,9 @@ class Cache {
|
|||
*/
|
||||
function set($settings = array(), $value = null) {
|
||||
$self =& Cache::getInstance();
|
||||
if (!isset($self->__config[$self->__name])) {
|
||||
if (!isset($self->__config[$self->__name]) || !isset($self->_engines[$self->__name])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = $self->__name;
|
||||
if (!empty($settings)) {
|
||||
$self->__reset = true;
|
||||
|
|
|
@ -64,6 +64,8 @@ class CacheTest extends CakeTestCase {
|
|||
$settings = array('engine' => 'File', 'path' => TMP . 'tests', 'prefix' => 'cake_test_');
|
||||
$results = Cache::config('new', $settings);
|
||||
$this->assertEqual($results, Cache::config('new'));
|
||||
$this->assertTrue(isset($results['engine']));
|
||||
$this->assertTrue(isset($results['settings']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,7 +73,7 @@ class CacheTest extends CakeTestCase {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function testConfigWithLibAndPluginEngines() {
|
||||
function XXtestConfigWithLibAndPluginEngines() {
|
||||
App::build(array(
|
||||
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
|
||||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
|
@ -148,9 +150,9 @@ class CacheTest extends CakeTestCase {
|
|||
$result = Cache::read('value_one');
|
||||
$this->assertEqual($result, null);
|
||||
|
||||
Cache::write('value_one', 'I am in another cache config!');
|
||||
Cache::write('value_one', 'I am in default config!');
|
||||
$result = Cache::read('value_one');
|
||||
$this->assertEqual($result, 'I am in another cache config!');
|
||||
$this->assertEqual($result, 'I am in default config!');
|
||||
|
||||
Cache::config('test_name');
|
||||
$result = Cache::read('value_one');
|
||||
|
|
Loading…
Reference in a new issue