r70058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70057‎ | r70058 | r70059 >
Date:23:05, 27 July 2010
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Make FlaggedRevs::parseStableText() use the parser cache if the rev id is also the latest
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -531,10 +531,16 @@
532532 }
533533 }
534534 }
535 - # Parse the new body, wikitext -> html
536 - $options = self::makeParserOptions(); // default options
537 - $parserOut = $wgParser->parse( $text, $title, $options, true, true, $id );
538 - # Stable parse done!
 535+ # Parse the new body, wikitext -> html. Maybe use parser cache
 536+ $options = self::makeParserOptions();
 537+ $parserOut = null;
 538+ if( $title->getLatestRevID() == $id ) {
 539+ $parserOut = ParserCache::singleton()->get( new Article( $title, 0 ), $options );
 540+ }
 541+ if( !$parserOut ) {
 542+ $parserOut = $wgParser->parse( $text, $title, $options, true, true, $id );
 543+ }
 544+
539545 if ( $resetManager ) {
540546 $incManager->clear(); // reset the FRInclusionManager as needed
541547 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r70059Revert r70058 per commentdemon00:03, 28 July 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   00:01, 28 July 2010

This wrong for almost all installations (those without FR_INCLUDES_CURRENT). I have a patch to do this correctly, but I didn't like the code forking just the performance of effectively one wiki.

#Comment by Aaron Schulz (talk | contribs)   00:03, 28 July 2010

Also, if that cache is to be used, it shouldn't be in this function.

#Comment by 😂 (talk | contribs)   00:04, 28 July 2010

Reverted in r70059.

Status & tagging log