Beispiel #1
0
function wfSetupParserFunctions()
{
    global $wgParser, $wgExtParserFunctions, $wgHooks;
    $wgExtParserFunctions = new ExtParserFunctions();
    // Check for SFH_OBJECT_ARGS capability
    if (defined('MW_SUPPORTS_PARSERFIRSTCALLINIT')) {
        $wgHooks['ParserFirstCallInit'][] = array(&$wgExtParserFunctions, 'registerParser');
    } else {
        if (class_exists('StubObject') && !StubObject::isRealObject($wgParser)) {
            $wgParser->_unstub();
        }
        $wgExtParserFunctions->registerParser($wgParser);
    }
    $wgHooks['ParserClearState'][] = array(&$wgExtParserFunctions, 'clearState');
}
function wfSetupParserFunctions()
{
    global $wgParser, $wgExtParserFunctions, $wgHooks;
    $wgExtParserFunctions = new ExtParserFunctions();
    // Check for SFH_OBJECT_ARGS capability
    /* DISABLED FOR GREAT S***E (DOESN'T F*****G WERK!!!) --Misza
    	if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
    		$wgHooks['ParserFirstCallInit'][] = array( &$wgExtParserFunctions, 'registerParser' );
    	} else {
    	*/
    if (class_exists('StubObject') && !StubObject::isRealObject($wgParser)) {
        $wgParser->_unstub();
    }
    $wgExtParserFunctions->registerParser($wgParser);
    //}
    $wgHooks['ParserClearState'][] = array(&$wgExtParserFunctions, 'clearState');
    $wgHooks['ParserAfterTidy'][] = array(&$wgExtParserFunctions, 'afterTidy');
}