Skip to content
Snippets Groups Projects
Commit a8795974 authored by Michael Hamann's avatar Michael Hamann
Browse files

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
c59b3e00
parent 069942ac
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment