r103178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103177‎ | r103178 | r103179 >
Date:14:52, 15 November 2011
Author:danwe
Status:deferred
Tags:
Comment:
Enabled limit report again + moved in hooks section
Modified paths:
  • /trunk/extensions/Loops/Loops.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Loops/Loops.php
@@ -33,6 +33,7 @@
3434
3535 // hooks registration:
3636 $wgHooks['ParserFirstCallInit'][] = 'ExtLoops::init';
 37+$wgHooks['ParserLimitReport' ][] = 'ExtLoops::onParserLimitReport';
3738 $wgHooks['ParserClearState' ][] = 'ExtLoops::onParserClearState';
3839
3940 // Include the settings file:
@@ -115,19 +116,7 @@
116117 $parser->setFunctionHook( $name, $functionCallback, SFH_OBJECT_ARGS );
117118 }
118119
119 -
120 - public function onParserLimitReport( $parser, &$report ) {
121 - // add performed loops to limit report:
122 - $report .= 'ExtLoops count: ' . self::getLoopsCount( $parser );
123 -
124 - if( self::$maxLoops > -1 ) {
125 - // if limit is set, communicate the limit as well:
126 - $report .= '/' . self::$maxLoops . "\n";
127 - }
128 - return true;
129 - }
130120
131 -
132121 ####################
133122 # Parser Functions #
134123 ####################
@@ -382,4 +371,17 @@
383372 $parser->mExtLoopsCounter = 0;
384373 return true;
385374 }
 375+
 376+ public static function onParserLimitReport( $parser, &$report ) {
 377+ // add performed loops to limit report:
 378+ $report .= 'ExtLoops count: ' . self::getLoopsCount( $parser );
 379+
 380+ if( self::$maxLoops > -1 ) {
 381+ // if limit is set, communicate the limit as well:
 382+ $report .= '/' . self::$maxLoops;
 383+ }
 384+ $report .= "\n";
 385+
 386+ return true;
 387+ }
386388 }

Status & tagging log