wiki.techinc.nl/maintenance/parserTestsParserHook.php
Ævar Arnfjörð Bjarmason 4a2c5f5571 * Renamed functions to make more sense
* added ?> to the file
2006-02-27 04:04:44 +00:00

34 lines
798 B
PHP

<?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.
*
* @package MediaWiki
* @subpackage 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>";
}
?>