From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 18:12:39 +0000 Subject: MediaWiki 1.7.1 wiederhergestellt --- maintenance/parserTestsStaticParserHook.php | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 maintenance/parserTestsStaticParserHook.php (limited to 'maintenance/parserTestsStaticParserHook.php') diff --git a/maintenance/parserTestsStaticParserHook.php b/maintenance/parserTestsStaticParserHook.php new file mode 100644 index 00000000..ac365aca --- /dev/null +++ b/maintenance/parserTestsStaticParserHook.php @@ -0,0 +1,44 @@ + + * @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'][] = 'wfParserTestStaticParserHookSetup'; + +function wfParserTestStaticParserHookSetup( &$parser ) { + $parser->setHook( 'statictag', 'wfParserTestStaticParserHookHook' ); + + return true; +} + +function wfParserTestStaticParserHookHook( $in, $argv ) { + static $buf = null; + + if ( ! count( $argv ) ) { + $buf = $in; + return ''; + } else if ( count( $argv ) === 1 && $argv['action'] === 'flush' && $in === null ) { + // Clear the buffer, we probably don't need to + $tmp = $buf; + $buf = null; + return $tmp; + } else + // wtf? + die( + "\nCall this extension as string or as" . + " , not in any other way.\n" . + "text: " . var_export( $in, true ) . "\n" . + "argv: " . var_export( $argv, true ) . "\n" + ); +} +?> -- cgit v1.2.2