summaryrefslogtreecommitdiff
path: root/maintenance/parserTestsParserHook.php
blob: 339cadab0d10448cb6cb9e56442772d7d9d6dc81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
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.
 *
 * @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'][] = 'wfParserTestParserHookSetup';

function wfParserTestParserHookSetup( &$parser ) {
	$parser->setHook( 'tag', 'wfParserTestParserHookHook' );

	return true;
}

function wfParserTestParserHookHook( $in, $argv ) {
	ob_start();
	var_dump(
		$in,
		$argv
	);
	$ret = ob_get_clean();

	return "<pre>\n$ret</pre>";
}
?>