Merge "Fix RecentChange::parseParams @return docs"
[lhc/web/wiklou.git] / includes / Revision.php
index 3db3744..79cab79 100644 (file)
@@ -1035,19 +1035,6 @@ class Revision implements IDBAccessObject {
                }
        }
 
-       /**
-        * Fetch revision text without regard for view restrictions
-        *
-        * @return string
-        *
-        * @deprecated since 1.21. Instead, use Revision::getContent( Revision::RAW )
-        *                         or Revision::getSerializedData() as appropriate.
-        */
-       public function getRawText() {
-               ContentHandler::deprecated( __METHOD__, "1.21" );
-               return $this->getText( self::RAW );
-       }
-
        /**
         * Fetch original serialized data without regard for view restrictions
         *
@@ -1549,14 +1536,24 @@ class Revision implements IDBAccessObject {
        protected function loadText() {
                // Caching may be beneficial for massive use of external storage
                global $wgRevisionCacheExpiry;
+               static $processCache = null;
+
+               if ( !$processCache ) {
+                       $processCache = new MapCacheLRU( 10 );
+               }
 
                $cache = ObjectCache::getMainWANInstance();
                $textId = $this->getTextId();
                $key = wfMemcKey( 'revisiontext', 'textid', $textId );
+
                if ( $wgRevisionCacheExpiry ) {
+                       if ( $processCache->has( $key ) ) {
+                               return $processCache->get( $key );
+                       }
                        $text = $cache->get( $key );
                        if ( is_string( $text ) ) {
                                wfDebug( __METHOD__ . ": got id $textId from cache\n" );
+                               $processCache->set( $key, $text );
                                return $text;
                        }
                }
@@ -1601,6 +1598,7 @@ class Revision implements IDBAccessObject {
 
                # No negative caching -- negative hits on text rows may be due to corrupted slave servers
                if ( $wgRevisionCacheExpiry && $text !== false ) {
+                       $processCache->set( $key, $text );
                        $cache->set( $key, $text, $wgRevisionCacheExpiry );
                }