r110204 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110203‎ | r110204 | r110205 >
Date:09:17, 28 January 2012
Author:ning
Status:ok
Tags:
Comment:
bug fix, $wgMessageCache and MessageCache::addMessages() don't exist anymore since r81027.
Modified paths:
  • /trunk/extensions/ExtTab/includes/ET_Initialize.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ExtTab/includes/ET_Initialize.php
@@ -18,54 +18,6 @@
1919 $wgExtensionMessagesFiles['ExtTabMagic'] = $smwgExtTabIP . '/languages/ExtTab.i18n.magic.php';
2020 $wgAutoloadClasses['ETParserFunctions'] = $smwgExtTabIP . '/includes/ET_ParserFunctions.php';
2121
22 -function smwfExtTabInitMessages() {
23 - global $smwgExtTabMessagesInitialized;
24 - if ( isset( $smwgExtTabMessagesInitialized ) ) return; // prevent double init
25 -
26 - smwfExtTabInitUserMessages(); // lazy init for ajax calls
27 -
28 - $smwgExtTabMessagesInitialized = true;
29 -}
30 -function smwfExtTabInitUserMessages() {
31 - global $wgMessageCache, $smwgExtTabContLang, $wgLanguageCode;
32 - smwfExtTabInitContentLanguage( $wgLanguageCode );
33 -
34 - global $smwgExtTabIP, $smwgExtTabLang;
35 - if ( !empty( $smwgExtTabLang ) ) { return; }
36 - global $wgMessageCache, $wgLang;
37 - $smwLangClass = 'ET_Language' . str_replace( '-', '_', ucfirst( $wgLang->getCode() ) );
38 -
39 - if ( file_exists( $smwgExtTabIP . '/languages/' . $smwLangClass . '.php' ) ) {
40 - include_once( $smwgExtTabIP . '/languages/' . $smwLangClass . '.php' );
41 - }
42 - // fallback if language not supported
43 - if ( !class_exists( $smwLangClass ) ) {
44 - global $smwgExtTabContLang;
45 - $smwgExtTabLang = $smwgExtTabContLang;
46 - } else {
47 - $smwgExtTabLang = new $smwLangClass();
48 - }
49 -
50 - $wgMessageCache->addMessages( $smwgExtTabLang->getUserMsgArray(), $wgLang->getCode() );
51 -}
52 -function smwfExtTabInitContentLanguage( $langcode ) {
53 - global $smwgExtTabIP, $smwgExtTabContLang;
54 - if ( !empty( $smwgExtTabContLang ) ) { return; }
55 -
56 - $smwContLangClass = 'ET_Language' . str_replace( '-', '_', ucfirst( $langcode ) );
57 -
58 - if ( file_exists( $smwgExtTabIP . '/languages/' . $smwContLangClass . '.php' ) ) {
59 - include_once( $smwgExtTabIP . '/languages/' . $smwContLangClass . '.php' );
60 - }
61 -
62 - // fallback if language not supported
63 - if ( !class_exists( $smwContLangClass ) ) {
64 - include_once( $smwgExtTabIP . '/languages/ET_LanguageEn.php' );
65 - $smwContLangClass = 'ET_LanguageEn';
66 - }
67 - $smwgExtTabContLang = new $smwContLangClass();
68 -}
69 -
7022 function smwfExtTabGetAjaxMethodPrefix() {
7123 $func_name = isset( $_POST["rs"] ) ? $_POST["rs"] : ( isset( $_GET["rs"] ) ? $_GET["rs"] : NULL );
7224 if ( $func_name == NULL ) return NULL;
@@ -80,8 +32,6 @@
8133 global $smwgExtTabIP, $wgExtensionCredits;
8234 global $wgParser, $wgHooks, $wgAutoloadClasses;
8335
84 - smwfExtTabInitMessages();
85 -
8636 // register hooks
8737 if ( defined( 'MW_SETPORTS_PARSERFIRSTCALLINIT' ) ) {
8838 $wgHooks['ParserFirstCallInit'][] = 'ETParserFunctions::registerFunctions';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81027* Replaced $wgMessageCache by MessageCache::singleton(); since we only use on...ialex15:42, 26 January 2011

Status & tagging log