Workaround for memcachedism
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 11 Sep 2005 17:33:25 +0000 (17:33 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 11 Sep 2005 17:33:25 +0000 (17:33 +0000)
includes/MessageCache.php

index 506bb19..be44654 100755 (executable)
@@ -309,7 +309,9 @@ class MessageCache
                # Try individual message cache
                if ( $this->mUseCache ) {
                        $message = $this->mMemc->get( $this->mMemcKey . ':' . $title );
-                       if( !is_null( $message ) ) {
+                       if ( $message == '###NONEXISTENT###' ) {
+                               return false;
+                       } elseif( !is_null( $message ) ) {
                                $this->mCache[$title] = $message;
                                return $message;
                        } else {
@@ -330,7 +332,8 @@ class MessageCache
                        }
                } else {
                        # Negative caching
-                       $this->mMemc->set( $this->mMemcKey . ':' . $title, false, $this->mExpiry );
+                       # Use some special text instead of false, because false gets converted to '' somewhere
+                       $this->mMemc->set( $this->mMemcKey . ':' . $title, '###NONEXISTENT###', $this->mExpiry );
                }
 
                return $message;