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:
mark_story 2009-11-21 16:09:06 -05:00
parent fb7d99e6b3
commit d37dd4c49f
3 changed files with 10 additions and 6 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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);