diff options
author | Adrian Lang <lang@cosmocode.de> | 2009-11-13 13:34:58 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2009-11-13 13:34:58 +0100 |
commit | c0322273adef5540c5e780c7a82329b5862a0871 (patch) | |
tree | 2220fa544fe4deee6e97c411a7b54d8b07818ebe /inc/cache.php | |
parent | 7d044e2a0700980fc1947982c674b56c359b35ae (diff) | |
download | rpg-c0322273adef5540c5e780c7a82329b5862a0871.tar.gz rpg-c0322273adef5540c5e780c7a82329b5862a0871.tar.bz2 |
Less E_NOTICEs, removed spell checker leftover
darcs-hash:20091113123458-e4919-d4841ea9c627059a4afa8e0032dd889b3cc579cb.gz
Diffstat (limited to 'inc/cache.php')
-rw-r--r-- | inc/cache.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/inc/cache.php b/inc/cache.php index c01e17c3e..9a9d5e3b0 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -217,24 +217,27 @@ class cache_renderer extends cache_parser { if (!parent::_useCache()) return false; - // for wiki pages, check metadata dependencies - if (isset($this->page)) { - $metadata = p_get_metadata($this->page); + if (!isset($this->page)) { + return true; + } - // check currnent link existence is consistent with cache version - // first check the purgefile - // - if the cache is more recent that the purgefile we know no links can have been updated - if ($this->_time < @filemtime($conf['cachedir'].'/purgefile')) { + // check current link existence is consistent with cache version + // first check the purgefile + // - if the cache is more recent than the purgefile we know no links can have been updated + if ($this->_time > @filemtime($conf['cachedir'].'/purgefile')) { + return true; + } -# $links = p_get_metadata($this->page,"relation references"); - $links = $metadata['relation']['references']; + // for wiki pages, check metadata dependencies + $metadata = p_get_metadata($this->page); - if (!empty($links)) { - foreach ($links as $id => $exists) { - if ($exists != page_exists($id,'',false)) return false; - } - } - } + if (!isset($metadata['relation']['references']) || + !empty($metadata['relation']['references'])) { + return true; + } + + foreach ($metadata['relation']['references'] as $id => $exists) { + if ($exists != page_exists($id,'',false)) return false; } return true; |