2 if ( ! defined( 'MEDIAWIKI' ) )
5 * A basic extension that's used by the parser tests to test whether the parser
6 * calls extensions when they're called inside comments, it shouldn't do that
8 * @addtogroup Maintenance
10 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
11 * @copyright Copyright © 2005, 2006 Ævar Arnfjörð Bjarmason
12 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
15 $wgHooks['ParserTestParser'][] = 'wfParserTestStaticParserHookSetup';
17 function wfParserTestStaticParserHookSetup( &$parser ) {
18 $parser->setHook( 'statictag', 'wfParserTestStaticParserHookHook' );
23 function wfParserTestStaticParserHookHook( $in, $argv ) {
26 if ( ! count( $argv ) ) {
29 } else if ( count( $argv ) === 1 && $argv['action'] === 'flush' && $in === null ) {
30 // Clear the buffer, we probably don't need to
37 "\nCall this extension as <statictag>string</statictag> or as" .
38 " <statictag action=flush/>, not in any other way.\n" .
39 "text: " . var_export( $in, true ) . "\n" .
40 "argv: " . var_export( $argv, true ) . "\n"