http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70058

Revision: 70058
Author:   demon
Date:     2010-07-27 23:05:17 +0000 (Tue, 27 Jul 2010)

Log Message:
-----------
Make FlaggedRevs::parseStableText() use the parser cache if the rev id is also 
the latest

Modified Paths:
--------------
    trunk/extensions/FlaggedRevs/FlaggedRevs.class.php

Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php  2010-07-27 23:00:17 UTC 
(rev 70057)
+++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php  2010-07-27 23:05:17 UTC 
(rev 70058)
@@ -531,10 +531,16 @@
                                }
                        }
                }
-               # Parse the new body, wikitext -> html
-               $options = self::makeParserOptions(); // default options
-               $parserOut = $wgParser->parse( $text, $title, $options, true, 
true, $id );
-               # Stable parse done!
+               # Parse the new body, wikitext -> html. Maybe use parser cache
+               $options = self::makeParserOptions();
+               $parserOut = null;
+               if( $title->getLatestRevID() == $id ) {
+                       $parserOut = ParserCache::singleton()->get( new 
Article( $title, 0 ), $options );
+               }
+               if( !$parserOut ) {
+                       $parserOut = $wgParser->parse( $text, $title, $options, 
true, true, $id );
+               }
+
                if ( $resetManager ) {
                        $incManager->clear(); // reset the FRInclusionManager 
as needed
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to