Fix for parser cache; pages containing variables are now updated without delay when...
authorMr. E23 <e23@users.mediawiki.org>
Sun, 15 Feb 2004 17:02:58 +0000 (17:02 +0000)
committerMr. E23 <e23@users.mediawiki.org>
Sun, 15 Feb 2004 17:02:58 +0000 (17:02 +0000)
includes/Article.php
includes/OutputPage.php

index 34d5ac5..f6bccf5 100644 (file)
@@ -1310,7 +1310,7 @@ class Article {
                        LinkCache::linksccClearPage( $title_obj->getArticleID() );
                }
                if ( $wgEnableParserCache ) {
-                       OutputPage::parsercacheClearPage( $title_obj->getArticleID() );
+                       OutputPage::parsercacheClearPage( $title_obj->getArticleID(), $title_obj->getNamespace() );
                }
        }
 }
index 617ba09..6f756a1 100644 (file)
@@ -1691,8 +1691,6 @@ $t[] = "</table>" ;
                $ser = addslashes( gzcompress( serialize( $data ) ) );
                if( $this->mContainsOldMagic ){
                        $expire = "1 HOUR";
-               } else if( $this->mContainsNewMagic ){
-                       $expire = "1 DAY";
                } else {
                        $expire = "7 DAY";
                }
@@ -1725,9 +1723,13 @@ $t[] = "</table>" ;
        }
 
        # $pid is a page id
-       /* static */ function parsercacheClearPage( $pid ){
+       /* static */ function parsercacheClearPage( $pid, $namespace ){
                $pid = intval( $pid );
-               wfQuery("DELETE FROM parsercache WHERE pc_pageid='{$pid}'", DB_WRITE);
+               if( $namespace == NS_MEDIAWIKI ){
+                       OutputPage::parsercacheClearLinksTo( $pid );
+               } else {
+                       wfQuery("DELETE FROM parsercache WHERE pc_pageid='{$pid}'", DB_WRITE);
+               }
        }
 }