* Add badsiglength to messages.inc
[lhc/web/wiklou.git] / maintenance / parserTestsParserHook.php
index 90c039c..339cada 100644 (file)
@@ -1,25 +1,33 @@
 <?php
-if (!defined('MEDIAWIKI')) die();
+if ( ! defined( 'MEDIAWIKI' ) )
+       die( -1 );
 /**
  * A basic extension that's used by the parser tests to test whether input and
  * arguments are passed to extensions properly.
  *
- * @package MediaWiki
- * @subpackage Maintenance
+ * @addtogroup Maintenance
  *
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+ * @copyright Copyright © 2005, 2006 Ævar Arnfjörð Bjarmason
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  */
 
-$wgHooks['ParserTestParser'][] = 'wfParserTestSetup';
+$wgHooks['ParserTestParser'][] = 'wfParserTestParserHookSetup';
 
-function wfParserTestSetup( &$parser ) {
-       $parser->setHook( 'tag', 'wfParserTestHook' );
+function wfParserTestParserHookSetup( &$parser ) {
+       $parser->setHook( 'tag', 'wfParserTestParserHookHook' );
+
+       return true;
 }
-       
-function wfParserTestHook( $in, $argv ) {
-       if ( count( $argv ) )
-               return "<pre>\n" . print_r( $argv, true ) . '</pre>';
-       else
-               return $in;
+
+function wfParserTestParserHookHook( $in, $argv ) {
+       ob_start();
+       var_dump(
+               $in,
+               $argv
+       );
+       $ret = ob_get_clean();
+
+       return "<pre>\n$ret</pre>";
 }
+?>