* Adding a space to the sh name so that it breaks across lines
[lhc/web/wiklou.git] / maintenance / parserTestsParserHook.php
1 <?php
2 if (!defined('MEDIAWIKI')) die();
3 /**
4 * A basic extension that's used by the parser tests to test whether input and
5 * arguments are passed to extensions properly.
6 *
7 * @package MediaWiki
8 * @subpackage Maintenance
9 *
10 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
11 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
12 */
13
14 $wgHooks['ParserTestParser'][] = 'wfParserSetup';
15
16 function wfParserSetup( &$parser ) {
17 $parser->setHook( 'tag', 'wfParserHook' );
18 }
19
20 function wfParserHook( $in, $argv ) {
21 if ( count( $argv ) )
22 return "<pre>\n" . print_r( $argv, true ) . '</pre>';
23 else
24 return $in;
25 }