r82603 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82602‎ | r82603 | r82604 >
Date:15:05, 22 February 2011
Author:platonides
Status:ok
Tags:
Comment:
Rename startExternalParse() when used for internal usage, per r80818 CR.
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -275,7 +275,7 @@
276276 wfProfileIn( __METHOD__ );
277277 wfProfileIn( $fname );
278278
279 - $this->startExternalParse( $title, $options, self::OT_HTML, $clearState );
 279+ $this->startParse( $title, $options, self::OT_HTML, $clearState );
280280
281281 $oldRevisionId = $this->mRevisionId;
282282 $oldRevisionObject = $this->mRevisionObject;
@@ -459,7 +459,7 @@
460460 */
461461 function preprocess( $text, Title $title, ParserOptions $options, $revid = null ) {
462462 wfProfileIn( __METHOD__ );
463 - $this->startExternalParse( $title, $options, self::OT_PREPROCESS, true );
 463+ $this->startParse( $title, $options, self::OT_PREPROCESS, true );
464464 if ( $revid !== null ) {
465465 $this->mRevisionId = $revid;
466466 }
@@ -479,7 +479,7 @@
480480 */
481481 public function getPreloadText( $text, Title $title, ParserOptions $options ) {
482482 # Parser (re)initialisation
483 - $this->startExternalParse( $title, $options, self::OT_PLAIN, true );
 483+ $this->startParse( $title, $options, self::OT_PLAIN, true );
484484
485485 $flags = PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES;
486486 $dom = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION );
@@ -4038,7 +4038,7 @@
40394039 * @return String: the altered wiki markup
40404040 */
40414041 public function preSaveTransform( $text, Title $title, User $user, ParserOptions $options, $clearState = true ) {
4042 - $this->startExternalParse( $title, $options, self::OT_WIKI, $clearState );
 4042+ $this->startParse( $title, $options, self::OT_WIKI, $clearState );
40434043 $this->setUser( $user );
40444044
40454045 $pairs = array(
@@ -4266,6 +4266,10 @@
42674267 * so that an external function can call some class members with confidence
42684268 */
42694269 public function startExternalParse( Title $title = null, ParserOptions $options, $outputType, $clearState = true ) {
 4270+ $this->startParse( $title, $options, $outputType, $clearState );
 4271+ }
 4272+
 4273+ private function startParse( Title $title = null, ParserOptions $options, $outputType, $clearState = true ) {
42704274 $this->setTitle( $title );
42714275 $this->mOptions = $options;
42724276 $this->setOutputType( $outputType );
@@ -4881,7 +4885,7 @@
48824886 */
48834887 private function extractSections( $text, $section, $mode, $newText='' ) {
48844888 global $wgTitle; # not generally used but removes an ugly failure mode
4885 - $this->startExternalParse( $wgTitle, new ParserOptions, self::OT_PLAIN, true );
 4889+ $this->startParse( $wgTitle, new ParserOptions, self::OT_PLAIN, true );
48864890 $outText = '';
48874891 $frame = $this->getPreprocessor()->newFrame();
48884892
@@ -5176,7 +5180,7 @@
51775181 if ( !$title instanceof Title ) {
51785182 $title = Title::newFromText( $title );
51795183 }
5180 - $this->startExternalParse( $title, $options, $outputType, true );
 5184+ $this->startParse( $title, $options, $outputType, true );
51815185
51825186 $text = $this->replaceVariables( $text );
51835187 $text = $this->mStripState->unstripBoth( $text );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80818Replace the repeated prologues to set mOptions, clearState(), setOutputType()...platonides16:07, 23 January 2011

Status & tagging log