Index: trunk/extensions/Loops/Loops.php |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | |
35 | 35 | // hooks registration: |
36 | 36 | $wgHooks['ParserFirstCallInit'][] = 'ExtLoops::init'; |
| 37 | +$wgHooks['ParserLimitReport' ][] = 'ExtLoops::onParserLimitReport'; |
37 | 38 | $wgHooks['ParserClearState' ][] = 'ExtLoops::onParserClearState'; |
38 | 39 | |
39 | 40 | // Include the settings file: |
— | — | @@ -115,19 +116,7 @@ |
116 | 117 | $parser->setFunctionHook( $name, $functionCallback, SFH_OBJECT_ARGS ); |
117 | 118 | } |
118 | 119 | |
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 | | - } |
130 | 120 | |
131 | | - |
132 | 121 | #################### |
133 | 122 | # Parser Functions # |
134 | 123 | #################### |
— | — | @@ -382,4 +371,17 @@ |
383 | 372 | $parser->mExtLoopsCounter = 0; |
384 | 373 | return true; |
385 | 374 | } |
| 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 | + } |
386 | 388 | } |