Index: trunk/phase3/languages/Language.php |
— | — | @@ -2095,14 +2095,20 @@ |
2096 | 2096 | return self::$dataCache->getItem( $this->mCode, 'magicWords' ); |
2097 | 2097 | } |
2098 | 2098 | |
| 2099 | + protected function doMagicHook() { |
| 2100 | + if ( $this->mMagicHookDone ) { |
| 2101 | + return; |
| 2102 | + } |
| 2103 | + $this->mMagicHookDone = true; |
| 2104 | + wfProfileIn( 'LanguageGetMagic' ); |
| 2105 | + wfRunHooks( 'LanguageGetMagic', array( &$this->mMagicExtensions, $this->getCode() ) ); |
| 2106 | + wfProfileOut( 'LanguageGetMagic' ); |
| 2107 | + } |
| 2108 | + |
2099 | 2109 | # Fill a MagicWord object with data from here |
2100 | 2110 | function getMagic( $mw ) { |
2101 | | - if ( !$this->mMagicHookDone ) { |
2102 | | - $this->mMagicHookDone = true; |
2103 | | - wfProfileIn( 'LanguageGetMagic' ); |
2104 | | - wfRunHooks( 'LanguageGetMagic', array( &$this->mMagicExtensions, $this->getCode() ) ); |
2105 | | - wfProfileOut( 'LanguageGetMagic' ); |
2106 | | - } |
| 2111 | + $this->doMagicHook(); |
| 2112 | + |
2107 | 2113 | if ( isset( $this->mMagicExtensions[$mw->mId] ) ) { |
2108 | 2114 | $rawEntry = $this->mMagicExtensions[$mw->mId]; |
2109 | 2115 | } else { |