From: Tim Starling Date: Thu, 17 Jan 2008 08:58:24 +0000 (+0000) Subject: Added ParserFirstCallInit hook. Deferred function registration in ParserFunctions... X-Git-Tag: 1.31.0-rc.0~49944 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=31baa8a17a46fa5b852a3cd5a8f7fb4e0e29e43c;p=lhc%2Fweb%2Fwiklou.git Added ParserFirstCallInit hook. Deferred function registration in ParserFunctions until this hook is called. --- diff --git a/includes/Defines.php b/includes/Defines.php index 1a62d45c54..1be90f9702 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -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 ); diff --git a/includes/Parser.php b/includes/Parser.php index 6132cc871e..24016d8c7f 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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__ ); } diff --git a/includes/Parser_OldPP.php b/includes/Parser_OldPP.php index c48ed3be6a..24711e99d4 100644 --- a/includes/Parser_OldPP.php +++ b/includes/Parser_OldPP.php @@ -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__ ); }