Added ParserFirstCallInit hook. Deferred function registration in ParserFunctions...
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 17 Jan 2008 08:58:24 +0000 (08:58 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 17 Jan 2008 08:58:24 +0000 (08:58 +0000)
includes/Defines.php
includes/Parser.php
includes/Parser_OldPP.php

index 1a62d45..1be90f9 100644 (file)
@@ -262,6 +262,7 @@ define( 'UTF8_TAIL', true );
 
 # Hook support constants
 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
+define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
 
 # Allowed values for Parser::$mOutputType
 # Parameter to Parser::startExternalParse().
@@ -282,4 +283,4 @@ define( 'RLH_FOR_UPDATE', 1 );
 define( 'APCOND_EDITCOUNT', 1 );
 define( 'APCOND_AGE', 2 );
 define( 'APCOND_EMAILCONFIRMED', 3 );
-define( 'APCOND_INGROUPS', 4 );
\ No newline at end of file
+define( 'APCOND_INGROUPS', 4 );
index 6132cc8..24016d8 100644 (file)
@@ -126,6 +126,7 @@ class Parser
                if ( !$this->mFirstCall ) {
                        return;
                }
+               $this->mFirstCall = false;
                
                wfProfileIn( __METHOD__ );
                global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions;
@@ -174,7 +175,8 @@ class Parser
                }
 
                $this->initialiseVariables();
-               $this->mFirstCall = false;
+
+               wfRunHooks( 'ParserFirstCallInit', array( &$this ) );
                wfProfileOut( __METHOD__ );
        }
 
index c48ed3b..24711e9 100644 (file)
@@ -81,6 +81,7 @@ class Parser_OldPP
                if ( !$this->mFirstCall ) {
                        return;
                }
+               $this->mFirstCall = false;
                
                wfProfileIn( __METHOD__ );
                global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions;
@@ -128,7 +129,8 @@ class Parser_OldPP
                }
 
                $this->initialiseVariables();
-               $this->mFirstCall = false;
+
+               wfRunHooks( 'ParserFirstCallInit', array( &$this ) );
                wfProfileOut( __METHOD__ );
        }