summaryrefslogtreecommitdiff
path: root/maintenance/parserTestsParserHook.php
blob: f55cd0e4d761fc2f3afcc8e1d64d1e46acb5eca7 (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
34
<?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.
 *
 * @file
 * @ingroup 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>";
}