Merge from SerbianVariants branch, trunk 16500 vs SerbianVariants 16523
[lhc/web/wiklou.git] / maintenance / parserTestsParserHook.php
1 <?php
2 if ( ! defined( 'MEDIAWIKI' ) )
3 die( -1 );
4 /**
5 * A basic extension that's used by the parser tests to test whether input and
6 * arguments are passed to extensions properly.
7 *
8 * @package MediaWiki
9 * @subpackage Maintenance
10 *
11 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
12 * @copyright Copyright © 2005, 2006 Ævar Arnfjörð Bjarmason
13 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
14 */
15
16 $wgHooks['ParserTestParser'][] = 'wfParserTestParserHookSetup';
17
18 function wfParserTestParserHookSetup( &$parser ) {
19 $parser->setHook( 'tag', 'wfParserTestParserHookHook' );
20
21 return true;
22 }
23
24 function wfParserTestParserHookHook( $in, $argv ) {
25 ob_start();
26 var_dump(
27 $in,
28 $argv
29 );
30 $ret = ob_get_clean();
31
32 return "<pre>\n$ret</pre>";
33 }
34 ?>