diff options
author | Michael Hamann <michael@content-space.de> | 2014-03-14 00:24:21 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2014-03-14 00:30:24 +0100 |
commit | a8795974051a91137b01ff88dbf5586a647b24ce (patch) | |
tree | dba630aa28ebe4f5c8e95e834e5d75c25e15493d | |
parent | 069942acdaa5ba825bc3f92c7093b5071789f1ca (diff) | |
download | rpg-a8795974051a91137b01ff88dbf5586a647b24ce.tar.gz rpg-a8795974051a91137b01ff88dbf5586a647b24ce.tar.bz2 |
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
-rw-r--r-- | inc/cache.php | 8 |
1 files changed, 5 insertions, 3 deletions
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; |