r69414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69413‎ | r69414 | r69415 >
Date:01:44, 16 July 2010
Author:tstarling
Status:ok
Tags:
Comment:
MFT r69191, r69204: use parser cache to display article HTML when diffing to current.
Modified paths:
  • /branches/wmf/1.16wmf4/includes/diff/DifferenceInterface.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/includes/diff/DifferenceInterface.php
@@ -421,8 +421,10 @@
422422 $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", 'rev-deleted-text-view' );
423423 }
424424
 425+ $pCache = true;
425426 if( !$this->mNewRev->isCurrent() ) {
426427 $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
 428+ $pCache = false;
427429 }
428430
429431 $this->loadNewText();
@@ -441,6 +443,14 @@
442444 $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) );
443445 $wgOut->addHTML( "\n</pre>\n" );
444446 }
 447+ } elseif( $pCache ) {
 448+ $article = new Article( $this->mTitle, 0 );
 449+ $pOutput = ParserCache::singleton()->get( $article, $wgUser );
 450+ if( $pOutput ) {
 451+ $wgOut->addParserOutput( $pOutput );
 452+ } else {
 453+ $article->doViewParse();
 454+ }
445455 } else {
446456 $wgOut->addWikiTextTidy( $this->mNewtext );
447457 }
Property changes on: branches/wmf/1.16wmf4/includes/diff/DifferenceInterface.php
___________________________________________________________________
Added: svn:mergeinfo
448458 Merged /branches/sqlite/includes/diff/DifferenceInterface.php:r58211-58321
449459 Merged /trunk/phase3/includes/diff/DifferenceInterface.php:r63549,63764,63897-63901,64802,69191,69204
450460 Merged /branches/wmf-deployment/includes/diff/DifferenceInterface.php:r53381,60970
451461 Merged /branches/REL1_15/phase3/includes/diff/DifferenceInterface.php:r51646

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69191(bug 24124) Diffs are taking 10 to 20 seconds to load. Use parser cache for p...demon17:01, 8 July 2010
r69204Cleanup to r69191: use addParserOutput() instead of addHtml(), specify curren...demon12:43, 9 July 2010

Status & tagging log