Index: trunk/extensions/LanguageSelector/LanguageSelector.php |
— | — | @@ -74,6 +74,7 @@ |
75 | 75 | $wgHooks['AddNewAccount'][] = 'wfLanguageSelectorAddNewAccount'; |
76 | 76 | $wgHooks['BeforePageDisplay'][] = 'wfLanguageSelectorBeforePageDisplay'; |
77 | 77 | $wgHooks['GetCacheVaryCookies'][] = 'wfLanguageSelectorGetCacheVaryCookies'; |
| 78 | +$wgHooks['ParserFirstCallInit'][] = 'wfLanguageSelectorSetHook'; |
78 | 79 | |
79 | 80 | $wgExtensionFunctions[] = 'wfLanguageSelectorExtension'; |
80 | 81 | |
— | — | @@ -95,10 +96,14 @@ |
96 | 97 | |
97 | 98 | function wfLanguageSelectorExtension() { |
98 | 99 | wfLoadExtensionMessages( 'LanguageSelector' ); |
99 | | - global $wgLanguageSelectorLanguages, $wgLanguageSelectorDetectLanguage, $wgLanguageSelectorRequestedLanguage, $wgLanguageSelectorLocation, $wgLanguageSelectorShowAll; |
| 100 | + global $wgLanguageSelectorLanguages, $wgLanguageSelectorDetectLanguage, |
| 101 | + $wgLanguageSelectorRequestedLanguage, $wgLanguageSelectorLocation, |
| 102 | + $wgLanguageSelectorShowAll, $wgCommandLineMode; |
100 | 103 | global $wgUser, $wgLang, $wgRequest, $wgCookiePrefix, $wgCookiePath, $wgHooks; |
101 | 104 | |
102 | | - $wgHooks['ParserFirstCallInit'][] = 'wfLanguageSelectorSetHook'; |
| 105 | + if ( $wgCommandLineMode ) { |
| 106 | + return true; |
| 107 | + } |
103 | 108 | |
104 | 109 | if ( $wgLanguageSelectorLanguages === null ) { |
105 | 110 | $wgLanguageSelectorLanguages = @$GLOBALS['wgPolyglotLanguages']; |