Capitalization fix in memcached setting
[lhc/web/wiklou.git] / includes / ParserCache.php
index 9b828b0..ed4384d 100644 (file)
@@ -1,5 +1,13 @@
 <?php
+/**
+ *
+ * @package MediaWiki
+ */
 
+/**
+ *
+ * @package MediaWiki
+ */
 class ParserCache
 {
        function getKey( &$article, &$user ) {
@@ -12,7 +20,7 @@ class ParserCache
        
        function get( &$article, &$user ) {
                global $wgMemc, $wgCacheEpoch;
-               $fname = "ParserCache::get";
+               $fname = 'ParserCache::get';
                wfProfileIn( $fname );
 
                $hash = $user->getPageRenderingHash();
@@ -20,11 +28,12 @@ class ParserCache
                $key = $this->getKey( $article, $user );
                wfDebug( "Trying parser cache $key\n" );
                $value = $wgMemc->get( $key );
-               if ( $value ) {
+               if ( is_object( $value ) ) {
                        wfDebug( "Found.\n" );
                        # Delete if article has changed since the cache was made
                        $canCache = $article->checkTouched();
                        $cacheTime = $value->getCacheTime();
+                       $touched = $article->mTouched;
                        if ( !$canCache || $value->getCacheTime() <= $touched || $cacheTime < $wgCacheEpoch ) {
                                if ( !$canCache ) {
                                        wfDebug( "Invalid cached redirect, touched $touched, epoch $wgCacheEpoch, cached $cacheTime\n" );
@@ -35,6 +44,7 @@ class ParserCache
                                $value = false;
                        }
                } else {
+                       wfDebug( "Parser cache miss.\n" );
                        $value = false;
                }