r78605 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78604‎ | r78605 | r78606 >
Date:21:23, 19 December 2010
Author:platonides
Status:deferred
Tags:
Comment:
Follow up r70823: store with the custom ParserOptions, too.
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -32,12 +32,13 @@
3333 function getSequenceSMIL(){
3434 global $wgParser,$wgOut, $wgUser, $wgEnableParserCache;
3535 //temporally stop cache:
36 - $wgEnableParserCache = $parserOutput =false;
 36+ $wgEnableParserCache = false;
3737
 38+ $parserOptions = ParserOptions::newFromUser( $wgUser );
 39+ $parserOptions->addExtraKey( 'mv:seq-xml' ); //differentiate the articles xml from article
 40+
3841 if( $wgEnableParserCache ) {
39 - $parserOptions = ParserOptions::newFromUser( $wgUser );
4042 $mvParserCache = ParserCache::singleton();
41 - $parserOptions->addExtraKey( 'mv:seq-xml' ); //differentiate the articles xml from article
4243 $parserOutput = $mvParserCache->get( $this, $parserOptions );
4344
4445 if( $parserOutput != false )
@@ -52,13 +53,13 @@
5354
5455 //@@todo get parser Output Object (maybe cleaner way to do this?
5556 //maybe parser cache is not the right place to cache the sequence xml? )
56 - $parserOutput = $wgParser->parse('', $this->mTitle, ParserOptions::newFromUser( $wgUser ));
 57+ $parserOutput = $wgParser->parse('', $this->mTitle, $parserOptions );
5758 //output header:
5859 $parserOutput->mText.=$this->smilDoc->saveXML();
5960
6061 //save to cache if parser cache enabled:
6162 if($wgEnableParserCache)
62 - $mvParserCache->save( $parserOutput, $this, $wgUser );
 63+ $mvParserCache->save( $parserOutput, $this, $parserOptions );
6364
6465 return $parserOutput->getText();
6566 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70823Use ParserOptions instead of User for ParserCache interface....platonides14:52, 10 August 2010

Status & tagging log