Merge branch 'core-1.0.0' into core
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 11 Dec 2008 22:07:54 +0000 (23:07 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 11 Dec 2008 22:07:54 +0000 (23:07 +0100)
classes/plwikipage.php
include/wiki.engine.inc.php

index 6f28191..787b293 100644 (file)
@@ -64,6 +64,18 @@ class PlWikiPage
         return self::workDir() . '/cache_' . $this->name . '.tpl';
     }
 
+    /** Remove the cache for the current page.
+     */
+    public function removePageCache()
+    {
+        @unlink($this->cacheFilename());
+        global $globals;
+        $page = glob($globals->spoolroot . '/spool/templates_c/*cache_' . $this->name . '.tpl.php');
+        if (count($page) > 0) {
+            @unlink($page[0]);
+        }
+    }
+
     /** Fetch the content of the wiki page.
      */
     private function fetchContent()
index fe72475..ae32040 100644 (file)
@@ -59,7 +59,8 @@ $wiki_cache   = $wp->cacheFilename();
 $cache_exists = file_exists($wiki_cache);
 if (Env::v('action') || !$cache_exists) {
     if ($cache_exists && !$feed) {
-        unlink($wiki_cache);
+        $wp->removePageCache();
+        $cache_exists = false;
     }
 
     // we leave pmwiki do whatever it wants and store everything