Allow to disable cache gc. By using a falsey value for probability

you can disable cache gc calls.
This commit is contained in:
Clément Hallet 2011-02-28 11:54:54 +01:00 committed by mark_story
parent 7853189328
commit e2b37d8ec9

View file

@ -149,7 +149,7 @@ class Cache {
$cacheClass = $class . 'Engine';
$this->_engines[$name] =& new $cacheClass();
if ($this->_engines[$name]->init($config)) {
if (time() % $this->_engines[$name]->settings['probability'] === 0) {
if ($this->_engines[$name]->settings['probability'] && time() % $this->_engines[$name]->settings['probability'] === 0) {
$this->_engines[$name]->gc();
}
return true;