mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
Updating doc block for FileEngine.
Fixing Cache::set() so strtotime compatible durations are handled properly. Restoring previous change in Xcache test case.
This commit is contained in:
parent
fb7d99e6b3
commit
d37dd4c49f
3 changed files with 10 additions and 6 deletions
|
@ -234,6 +234,9 @@ class Cache {
|
|||
$settings = array($settings => $value);
|
||||
}
|
||||
$settings = array_merge($self->__config[$self->__name], $settings);
|
||||
if (isset($settings['duration']) && !is_numeric($settings['duration'])) {
|
||||
$settings['duration'] = strtotime($settings['duration']) - time();
|
||||
}
|
||||
}
|
||||
$self->_engines[$name]->settings = $settings;
|
||||
}
|
||||
|
|
11
cake/libs/cache/file.php
vendored
11
cake/libs/cache/file.php
vendored
|
@ -37,11 +37,12 @@ class FileEngine extends CacheEngine {
|
|||
var $__File = null;
|
||||
|
||||
/**
|
||||
* settings
|
||||
* path = absolute path to cache directory, default => CACHE
|
||||
* prefix = string prefix for filename, default => cake_
|
||||
* lock = enable file locking on write, default => false
|
||||
* serialize = serialize the data, default => true
|
||||
* Settings
|
||||
*
|
||||
* - path = absolute path to cache directory, default => CACHE
|
||||
* - prefix = string prefix for filename, default => cake_
|
||||
* - lock = enable file locking on write, default => false
|
||||
* - serialize = serialize the data, default => true
|
||||
*
|
||||
* @var array
|
||||
* @see CacheEngine::__defaults
|
||||
|
|
2
cake/tests/cases/libs/cache/xcache.test.php
vendored
2
cake/tests/cases/libs/cache/xcache.test.php
vendored
|
@ -132,7 +132,7 @@ class XcacheEngineTest extends UnitTestCase {
|
|||
$result = Cache::read('other_test');
|
||||
$this->assertFalse($result);
|
||||
|
||||
Cache::set(array('duration' => 1));
|
||||
Cache::set(array('duration' => "+1 second"));
|
||||
|
||||
$data = 'this is a test of the emergency broadcasting system';
|
||||
$result = Cache::write('other_test', $data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue