From a8795974051a91137b01ff88dbf5586a647b24ce Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 14 Mar 2014 00:24:21 +0100 Subject: Fix caching (make the event callback public again) Caching had been completely broken (disabled) for caches with events because the default event handler (cache::_useCache()) was protected and thus couldn't be executed by the event handler. This was broken in c59b3e001d1e8258b1d118909257b70516c8a6b1 --- inc/cache.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 5f54a34a9..56c5b65f2 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -63,11 +63,13 @@ class cache { * age - expire cache if older than age (seconds) * files - expire cache if any file in this array was updated more recently than the cache * + * Note that this function needs to be public as it is used as callback for the event handler + * * can be overridden * * @return bool see useCache() */ - protected function _useCache() { + public function _useCache() { if (!empty($this->depends['purge'])) return false; // purge requested? if (!($this->_time = @filemtime($this->cache))) return false; // cache exists? @@ -194,7 +196,7 @@ class cache_parser extends cache { * * @return bool see useCache() */ - protected function _useCache() { + public function _useCache() { if (!@file_exists($this->file)) return false; // source exists? return parent::_useCache(); @@ -229,7 +231,7 @@ class cache_renderer extends cache_parser { * * @return bool see useCache() */ - protected function _useCache() { + public function _useCache() { global $conf; if (!parent::_useCache()) return false; -- cgit v1.2.3