Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | ipb_reason tinyblob NOT NULL default '', |
116 | 116 | ipb_timestamp char(14) binary NOT NULL default '', |
117 | 117 | ipb_auto tinyint(1) NOT NULL default '0', |
118 | | - UNIQUE KEY ipb_id |
| 118 | + UNIQUE KEY ipb_id (ipb_id) |
119 | 119 | ) TYPE=MyISAM PACK_KEYS=1; |
120 | 120 | |
121 | 121 | DROP TABLE IF EXISTS image; |
Index: trunk/phase3/docs/memcached.doc |
— | — | @@ -109,5 +109,11 @@ |
110 | 110 | set in: LinkCache::addLink() |
111 | 111 | cleared by: LinkCache::clearBadLink() |
112 | 112 | should be cleared on page deletion and rename |
113 | | - |
| 113 | +MediaWiki namespace: |
| 114 | + key: $wgDBname:MediaWiki:title:$title |
| 115 | + ex: wikidb:MediaWiki:title:Blockedtext |
| 116 | + stores: string |
| 117 | + set in: wfMsg() |
| 118 | + cleared by: Article::editUpdates() |
| 119 | + |
114 | 120 | ... more to come ... |
Index: trunk/phase3/install.php |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | $DP = "./includes"; |
23 | 23 | include_once( "./LocalSettings.php" ); |
24 | 24 | include_once( "./AdminSettings.php" ); |
| 25 | +include_once( "./maintenance/InitialiseMessages.php" ); |
25 | 26 | |
26 | 27 | if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) { |
27 | 28 | print "To use math functions, you must first compile texvc by\n" . |
— | — | @@ -272,26 +273,30 @@ |
273 | 274 | } |
274 | 275 | |
275 | 276 | $wns = Namespace::getWikipedia(); |
276 | | - $ulp = addslashes( wfMsg( "uploadlogpage" ) ); |
277 | | - $dlp = addslashes( wfMsg( "dellogpage" ) ); |
| 277 | + $ulp = addslashes( wfMsgNoDB( "uploadlogpage" ) ); |
| 278 | + $dlp = addslashes( wfMsgNoDB( "dellogpage" ) ); |
278 | 279 | |
279 | 280 | $sql = "DELETE FROM cur"; |
280 | 281 | wfQuery( $sql, DB_WRITE, $fname ); |
281 | 282 | |
282 | 283 | $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," . |
283 | 284 | "cur_restrictions) VALUES ({$wns},'{$ulp}','" . |
284 | | - wfStrencode( wfMsg( "uploadlogpagetext" ) ) . "','sysop')"; |
| 285 | + wfStrencode( wfMsgNoDB( "uploadlogpagetext" ) ) . "','sysop')"; |
285 | 286 | wfQuery( $sql, DB_WRITE, $fname ); |
286 | 287 | |
287 | 288 | $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," . |
288 | 289 | "cur_restrictions) VALUES ({$wns},'{$dlp}','" . |
289 | | - wfStrencode( wfMsg( "dellogpagetext" ) ) . "','sysop')"; |
| 290 | + wfStrencode( wfMsgNoDB( "dellogpagetext" ) ) . "','sysop')"; |
290 | 291 | wfQuery( $sql, DB_WRITE, $fname ); |
291 | | - |
| 292 | + |
| 293 | + $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); |
| 294 | + $title = $titleobj->getDBkey(); |
292 | 295 | $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text) " . |
293 | | - "VALUES (0,'" . wfStrencode( wfMsg( "mainpage" ) ) . "','" . |
294 | | - wfStrencode( wfMsg( "mainpagetext" ) ) . "')"; |
| 296 | + "VALUES (0,'$title','" . |
| 297 | + wfStrencode( wfMsgNoDB( "mainpagetext" ) ) . "')"; |
295 | 298 | wfQuery( $sql, DB_WRITE, $fname ); |
| 299 | + |
| 300 | + initialiseMessages(); |
296 | 301 | } |
297 | 302 | |
298 | 303 | ?> |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | |
17 | 17 | class MagicWord { |
18 | 18 | /*private*/ var $mId, $mSynonyms, $mCaseSensitive, $mRegex; |
19 | | - /*private*/ var $mRegexStart, $mBaseRegex; |
| 19 | + /*private*/ var $mRegexStart, $mBaseRegex, $mVariableRegex; |
20 | 20 | |
21 | 21 | function MagicWord($id = 0, $syn = "", $cs = false) |
22 | 22 | { |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | $this->mCaseSensitive = $cs; |
26 | 26 | $this->mRegex = ""; |
27 | 27 | $this->mRegexStart = ""; |
| 28 | + $this->mVariableRegex = ""; |
28 | 29 | } |
29 | 30 | |
30 | 31 | /*static*/ function &get( $id ) |
— | — | @@ -53,6 +54,8 @@ |
54 | 55 | $case = $this->mCaseSensitive ? "" : "i"; |
55 | 56 | $this->mRegex = "/{$this->mBaseRegex}/{$case}"; |
56 | 57 | $this->mRegexStart = "/^{$this->mBaseRegex}/{$case}"; |
| 58 | + $this->mVariableRegex = str_replace( "\\$1", "([A-Za-z0-9]*)", $this->mRegex ); |
| 59 | + wfDebug( "{$this->mVariableRegex}\n" ); |
57 | 60 | } |
58 | 61 | |
59 | 62 | function getRegex() |
— | — | @@ -100,6 +103,23 @@ |
101 | 104 | { |
102 | 105 | return preg_replace( $this->getRegex(), $replacement, $subject ); |
103 | 106 | } |
| 107 | + |
| 108 | + function substituteCallback( $text, $callback ) { |
| 109 | + $regex = $this->getVariableRegex(); |
| 110 | + return preg_replace_callback( $this->getVariableRegex(), $callback, $text ); |
| 111 | + } |
| 112 | + |
| 113 | + function getVariableRegex() |
| 114 | + { |
| 115 | + if ( $this->mVariableRegex == "" ) { |
| 116 | + $this->initRegex(); |
| 117 | + } |
| 118 | + return $this->mVariableRegex; |
| 119 | + } |
| 120 | + |
| 121 | + function getSynonym( $i ) { |
| 122 | + return $this->mSynonyms[$i]; |
| 123 | + } |
104 | 124 | } |
105 | 125 | |
106 | 126 | /*private*/ function pregRemoveAndRecord( $match ) |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -953,7 +953,7 @@ |
954 | 954 | |
955 | 955 | /* private */ function editUpdates( $text ) |
956 | 956 | { |
957 | | - global $wgDeferredUpdateList; |
| 957 | + global $wgDeferredUpdateList, $wgDBname, $wgMemc; |
958 | 958 | |
959 | 959 | wfSeedRandom(); |
960 | 960 | if ( 0 == mt_rand( 0, 999 ) ) { |
— | — | @@ -976,6 +976,11 @@ |
977 | 977 | $u = new UserTalkUpdate( 1, $this->mTitle->getNamespace(), |
978 | 978 | $this->mTitle->getDBkey() ); |
979 | 979 | array_push( $wgDeferredUpdateList, $u ); |
| 980 | + |
| 981 | + if ( $this->getNamespace == NS_MEDIAWIKI ) { |
| 982 | + $key = "$wgDBname:MediaWiki:title:" . $this->mTitle->getDBkey(); |
| 983 | + $wgMemc->delete( $key ); |
| 984 | + } |
980 | 985 | } |
981 | 986 | } |
982 | 987 | |
— | — | @@ -1055,6 +1060,11 @@ |
1056 | 1061 | } else { |
1057 | 1062 | $text = preg_replace( $p2, "[[\\1 ({$context})|\\1]]", $text ); |
1058 | 1063 | } |
| 1064 | + |
| 1065 | + # {{SUBST:xxx}} variables |
| 1066 | + # |
| 1067 | + $mw =& MagicWord::get( MAG_SUBST ); |
| 1068 | + $text = $mw->substituteCallback( $text, "replaceMsgVar" ); |
1059 | 1069 | |
1060 | 1070 | return $text; |
1061 | 1071 | } |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -173,38 +173,83 @@ |
174 | 174 | } |
175 | 175 | |
176 | 176 | $wgReplacementKeys = array( "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9" ); |
177 | | -function wfMsg( $key ) |
178 | | -{ |
179 | | - global $wgLang, $wgReplacementKeys; |
180 | | - $message = $wgLang->getMessage( $key ); |
| 177 | + |
| 178 | +function wfMsg( $key ) { |
| 179 | + $args = func_get_args(); |
| 180 | + if ( count( $args ) ) { |
| 181 | + array_shift( $args ); |
| 182 | + } |
| 183 | + return wfMsgReal( $key, $args, true ); |
| 184 | +} |
| 185 | + |
| 186 | +function wfMsgNoDB( $key ) { |
| 187 | + $args = func_get_args(); |
| 188 | + if ( count( $args ) ) { |
| 189 | + array_shift( $args ); |
| 190 | + } |
| 191 | + return wfMsgReal( $key, $args, false ); |
| 192 | +} |
| 193 | + |
| 194 | +function wfMsgReal( $key, $args, $useDB ) { |
| 195 | + global $wgLang, $wgReplacementKeys, $wgMemc, $wgDBname; |
| 196 | + global $wgUseDatabaseMessages; |
| 197 | + |
| 198 | + static $l1cache = array(); |
| 199 | + $fname = "wfMsg"; |
| 200 | + $message = false; |
| 201 | + $l1hit = false; |
181 | 202 | |
182 | | - if ( $message{0} == ":" ) { |
183 | | - # Get message from the database |
184 | | - $message = substr( $message, 1 ); |
185 | | - $title = Title::newFromText( $message ); |
186 | | - $dbKey = $title->getDBkey(); |
187 | | - $ns = $title->getNamespace(); |
188 | | - $sql = "SELECT cur_text FROM cur WHERE cur_namespace=$ns AND cur_title='$dbKey'"; |
189 | | - $res = wfQuery( $sql, DB_READ, $fname ); |
190 | | - if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) { |
191 | | - $message = $s->cur_text; |
192 | | - # filter out a comment at the top if there is one |
193 | | - $commentPos = strpos( $message, "__START__" ); |
194 | | - if ( $commentPos !== false ) { |
195 | | - $message = substr( $message, $commentPos + strlen( "__START__" ) ); |
196 | | - wfDebug( "Comment filtered at pos $commentPos, \"$message\"\n" ); |
| 203 | + # Check for DB suppression |
| 204 | + if ( !$wgUseDatabaseMessages || !$useDB ) { |
| 205 | + $message = $wgLang->getMessage( $key ); |
| 206 | + } |
| 207 | + |
| 208 | + # Try L1 cache |
| 209 | + if ( $message === false && array_key_exists( $key, $l1cache ) ) { |
| 210 | + $message = $l1cache[$key]; |
| 211 | + if ( $message === false ) { |
| 212 | + $message = $wgLang->getMessage( $key ); |
| 213 | + } |
| 214 | + $l1hit = true; |
| 215 | + } |
| 216 | + |
| 217 | + # Try memcached |
| 218 | + if ( $message === false ) { |
| 219 | + $titleObj = Title::newFromText( $key ); |
| 220 | + $title = $titleObj->getDBkey(); |
| 221 | + $mcKey = "$wgDBname:MediaWiki:title:$title"; |
| 222 | + $message = $wgMemc->get( $mcKey ); |
| 223 | + } |
| 224 | + |
| 225 | + # Try database |
| 226 | + if ( $message === false) { |
| 227 | + if ( $useDB ) { |
| 228 | + $sql = "SELECT cur_text FROM cur WHERE cur_namespace=" . NS_MEDIAWIKI . |
| 229 | + " AND cur_title='$title'"; |
| 230 | + $res = wfQuery( $sql, DB_READ, $fname ); |
| 231 | + |
| 232 | + if ( wfNumRows( $res ) ) { |
| 233 | + # Got it from the database, now store in MemCached |
| 234 | + $obj = wfFetchObject( $res ); |
| 235 | + $message = $obj->cur_text; |
| 236 | + wfFreeResult( $res ); |
| 237 | + $wgMemc->set( $key, $message, time() + 1800 ); |
197 | 238 | } |
198 | | - } else { |
199 | | - # if the page doesn't exist, just make a link to where it should be |
200 | | - $message = "[[$message]]"; |
201 | | - } |
202 | | - wfFreeResult( $res ); |
| 239 | + } |
203 | 240 | } |
204 | | - if( func_num_args() > 1 ) { |
205 | | - $reps = func_get_args(); |
206 | | - array_shift( $reps ); |
207 | | - $message = str_replace( $wgReplacementKeys, $reps, $message ); |
| 241 | + |
| 242 | + # Finally, try the array in $wgLang |
| 243 | + if ( $message === false ) { |
| 244 | + $message = $wgLang->getMessage( $key ); |
| 245 | + $l1cache[$key] = false; |
| 246 | + } elseif ( !$l1hit && $wgUseDatabaseMessages) { |
| 247 | + $l1cache[$key] = $message; |
208 | 248 | } |
| 249 | + |
| 250 | + # Replace arguments |
| 251 | + if( count( $args ) ) { |
| 252 | + $message = str_replace( $wgReplacementKeys, $args, $message ); |
| 253 | + } |
209 | 254 | |
210 | 255 | if ( "" == $message ) { |
211 | 256 | # Let's at least _try_ to be graceful about this. |
— | — | @@ -590,4 +635,14 @@ |
591 | 636 | return array( $limit, $offset ); |
592 | 637 | } |
593 | 638 | |
| 639 | +# Used in OutputPage::replaceVariables and Article:pstPass2 |
| 640 | +function replaceMsgVar( $matches ) { |
| 641 | + return wfMsg( $matches[1] ); |
| 642 | +} |
| 643 | + |
| 644 | +function replaceMsgVarNw( $matches ) { |
| 645 | + $text = htmlspecialchars( wfMsg( $matches[1] ) ); |
| 646 | + return $text; |
| 647 | +} |
| 648 | + |
594 | 649 | ?> |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -61,6 +61,10 @@ |
62 | 62 | $wgShowIPinHeader = true; # For non-logged in users |
63 | 63 | $wgUseDynamicDates = true; # Allows the user to pick their preferred date format |
64 | 64 | |
| 65 | +# Translation using MediaWiki: namespace |
| 66 | +# Not recommended unless memcached is installed |
| 67 | +$wgUseDatabaseMessages = false; |
| 68 | + |
65 | 69 | # Miscellaneous configuration settings |
66 | 70 | # |
67 | 71 | $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR"; |
— | — | @@ -70,6 +74,8 @@ |
71 | 75 | $wgSqlLogFile = "{$wgUploadDirectory}/sqllog_mFhyRe6"; |
72 | 76 | $wgLogQueries = false; |
73 | 77 | $wgUseBetterLinksUpdate = true; |
| 78 | + |
| 79 | +# User rights settings |
74 | 80 | $wgSysopUserBans = true; # Allow sysops to ban logged-in users |
75 | 81 | $wgIPBlockExpiration = 86400; # IP blocks expire after this many seconds, 0=infinite |
76 | 82 | $wgUserBlockExpiration = 0; # As above, but for logged-in users |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -428,28 +428,29 @@ |
429 | 429 | function databaseError( $fname ) |
430 | 430 | { |
431 | 431 | global $wgUser, $wgCommandLineMode; |
432 | | - |
433 | | - $this->setPageTitle( wfMsg( "databaseerror" ) ); |
| 432 | + |
| 433 | + $this->setPageTitle( wfMsgNoDB( "databaseerror" ) ); |
434 | 434 | $this->setRobotpolicy( "noindex,nofollow" ); |
435 | 435 | $this->setArticleFlag( false ); |
436 | 436 | |
437 | 437 | if ( $wgCommandLineMode ) { |
438 | | - $msg = wfMsg( "dberrortextcl" ); |
| 438 | + $msg = wfMsgNoDB( "dberrortextcl" ); |
439 | 439 | } else { |
440 | | - $msg = wfMsg( "dberrortextcl" ); |
| 440 | + $msg = wfMsgNoDB( "dberrortextcl" ); |
441 | 441 | } |
| 442 | + |
442 | 443 | $msg = str_replace( "$1", htmlspecialchars( wfLastDBquery() ), $msg ); |
443 | 444 | $msg = str_replace( "$2", htmlspecialchars( $fname ), $msg ); |
444 | 445 | $msg = str_replace( "$3", wfLastErrno(), $msg ); |
445 | 446 | $msg = str_replace( "$4", htmlspecialchars( wfLastError() ), $msg ); |
446 | | - |
| 447 | + |
447 | 448 | if ( $wgCommandLineMode ) { |
448 | | - print $msg; |
| 449 | + print "$msg\n"; |
449 | 450 | exit(); |
450 | 451 | } |
451 | 452 | $sk = $wgUser->getSkin(); |
452 | | - $shlink = $sk->makeKnownLink( wfMsg( "searchhelppage" ), |
453 | | - wfMsg( "searchingwikipedia" ) ); |
| 453 | + $shlink = $sk->makeKnownLink( wfMsgNoDB( "searchhelppage" ), |
| 454 | + wfMsgNoDB( "searchingwikipedia" ) ); |
454 | 455 | $msg = str_replace( "$5", $shlink, $msg ); |
455 | 456 | |
456 | 457 | $this->mBodytext = $msg; |
— | — | @@ -1246,6 +1247,14 @@ |
1247 | 1248 | $v = wfNumberOfArticles(); |
1248 | 1249 | $text = $mw->replace( $v, $text ); |
1249 | 1250 | } |
| 1251 | + |
| 1252 | + # The callbacks are in GlobalFunctions.php |
| 1253 | + $mw =& MagicWord::get( MAG_MSG ); |
| 1254 | + $text = $mw->substituteCallback( $text, "replaceMsgVar" ); |
| 1255 | + |
| 1256 | + $mw =& MagicWord::get( MAG_MSGNW ); |
| 1257 | + $text = $mw->substituteCallback( $text, "replaceMsgVarNw" ); |
| 1258 | + |
1250 | 1259 | wfProfileOut(); |
1251 | 1260 | return $text; |
1252 | 1261 | } |
Index: trunk/phase3/includes/DatabaseFunctions.php |
— | — | @@ -13,10 +13,10 @@ |
14 | 14 | { |
15 | 15 | global $wgDBserver, $wgDBuser, $wgDBpassword; |
16 | 16 | global $wgDBname, $wgDBconnection, $wgEmergencyContact; |
| 17 | + |
| 18 | + $noconn = str_replace( "$1", $wgDBserver, wfMsgNoDB( "noconnect" ) ); |
| 19 | + $nodb = str_replace( "$1", $wgDBname, wfMsgNoDB( "nodb" ) ); |
17 | 20 | |
18 | | - $noconn = str_replace( "$1", $wgDBserver, wfMsg( "noconnect" ) ); |
19 | | - $nodb = str_replace( "$1", $wgDBname, wfMsg( "nodb" ) ); |
20 | | - |
21 | 21 | $helpme = "\n<p>If this error persists after reloading and clearing " . |
22 | 22 | "your browser cache, please notify the <a href=\"mailto:" . |
23 | 23 | $wgEmergencyContact . "\">Wikipedia developers</a>.</p>"; |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | global $wgTitle, $wgUseFileCache, $title, $wgOutputEncoding; |
57 | 57 | |
58 | 58 | header( "Content-type: text/html; charset=$wgOutputEncoding" ); |
59 | | - if($msg == "") $msg = wfMsg( "noconnect" ); |
| 59 | + if($msg == "") $msg = wfMsgNoDB( "noconnect" ); |
60 | 60 | $text = $msg; |
61 | 61 | |
62 | 62 | if($wgUseFileCache) { |
— | — | @@ -65,14 +65,14 @@ |
66 | 66 | if($title) { |
67 | 67 | $t = Title::newFromURL( $title ); |
68 | 68 | } else { |
69 | | - $t = Title::newFromText( wfMsg("mainpage") ); |
| 69 | + $t = Title::newFromText( wfMsgNoDB( "mainpage" ) ); |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | 73 | $cache = new CacheManager( $t ); |
74 | 74 | if( $cache->isFileCached() ) { |
75 | 75 | $msg = "<p style='color: red'><b>$msg<br>\n" . |
76 | | - wfMsg( "cachederror" ) . "</b></p>\n"; |
| 76 | + wfMsgNoDB( "cachederror" ) . "</b></p>\n"; |
77 | 77 | |
78 | 78 | $tag = "<div id='article'>"; |
79 | 79 | $text = str_replace( |
— | — | @@ -98,7 +98,6 @@ |
99 | 99 | global $wgLastDatabaseQuery, $wgOut; |
100 | 100 | ## wfProfileIn( "wfQuery" ); |
101 | 101 | $wgLastDatabaseQuery = $sql; |
102 | | - |
103 | 102 | $conn = wfGetDB(); |
104 | 103 | $ret = mysql_query( $sql, $conn ); |
105 | 104 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -14,6 +14,8 @@ |
15 | 15 | define("NS_WP_TALK", 5); |
16 | 16 | define("NS_IMAGE", 6); |
17 | 17 | define("NS_IMAGE_TALK", 7); |
| 18 | +define("NS_MEDIAWIKI", 8); |
| 19 | +define("NS_MEDIAWIKI_TALK", 9); |
18 | 20 | |
19 | 21 | # Magic words |
20 | 22 | define("MAG_REDIRECT", 0); |
— | — | @@ -27,6 +29,9 @@ |
28 | 30 | define("MAG_CURRENTTIME", 8); |
29 | 31 | define("MAG_NUMBEROFARTICLES", 9); |
30 | 32 | define("MAG_CURRENTMONTHNAMEGEN", 10); |
| 33 | +define("MAG_MSG", 11); |
| 34 | +define("MAG_SUBST", 12); |
| 35 | +define("MAG_MSGNW", 13); |
31 | 36 | |
32 | 37 | #-------------------------------------------------------------------------- |
33 | 38 | # Language-specific text |
— | — | @@ -48,7 +53,9 @@ |
49 | 54 | 4 => "Wikipedia", |
50 | 55 | 5 => "Wikipedia_talk", |
51 | 56 | 6 => "Image", |
52 | | - 7 => "Image_talk" |
| 57 | + 7 => "Image_talk", |
| 58 | + 8 => "MediaWiki", |
| 59 | + 9 => "MediaWiki_talk" |
53 | 60 | ); |
54 | 61 | |
55 | 62 | /* private */ $wgDefaultUserOptionsEn = array( |
— | — | @@ -285,6 +292,9 @@ |
286 | 293 | MAG_CURRENTTIME => array( 1, "{{CURRENTTIME}}" ), |
287 | 294 | MAG_NUMBEROFARTICLES => array( 1, "{{NUMBEROFARTICLES}}" ), |
288 | 295 | MAG_CURRENTMONTHNAMEGEN => array( 1, "{{CURRENTMONTHNAMEGEN}}"), |
| 296 | + MAG_MSG => array( 1, "{{MSG:$1}}" ), |
| 297 | + MAG_SUBST => array( 1, "{{SUBST:$1}}" ), |
| 298 | + MAG_MSGNW => array( 1, "{{MSGNW:$1}}" ) |
289 | 299 | ); |
290 | 300 | |
291 | 301 | # All special pages have to be listed here: a description of "" |
— | — | @@ -1223,6 +1233,10 @@ |
1224 | 1234 | amusement.", |
1225 | 1235 | "exportcuronly" => "Include only the current revision, not the full history", |
1226 | 1236 | |
| 1237 | +# Namespace 8 related |
| 1238 | + |
| 1239 | +"allmessages" => "All_messages", |
| 1240 | +"allmessagestext" => "This is a list of all messages available in the MediaWiki: namespace" |
1227 | 1241 | ); |
1228 | 1242 | |
1229 | 1243 | #-------------------------------------------------------------------------- |
— | — | @@ -1426,6 +1440,12 @@ |
1427 | 1441 | return $wgAllMessagesEn[$key]; |
1428 | 1442 | } |
1429 | 1443 | |
| 1444 | + function getAllMessages() |
| 1445 | + { |
| 1446 | + global $wgAllMessagesEn; |
| 1447 | + return $wgAllMessagesEn; |
| 1448 | + } |
| 1449 | + |
1430 | 1450 | function iconv( $in, $out, $string ) { |
1431 | 1451 | # For most languages, this is a wrapper for iconv |
1432 | 1452 | return iconv( $in, $out, $string ); |
Index: trunk/phase3/update.php |
— | — | @@ -25,13 +25,15 @@ |
26 | 26 | |
27 | 27 | include_once( "Version.php" ); |
28 | 28 | include_once( "{$IP}/Setup.php" ); |
| 29 | +include_once( "./maintenance/InitialiseMessages.php" ); |
| 30 | + |
29 | 31 | $wgTitle = Title::newFromText( "Update script" ); |
30 | 32 | $wgCommandLineMode = true; |
31 | 33 | $wgAlterSpecs = array(); |
32 | 34 | |
33 | 35 | do_revision_updates(); |
34 | | - |
35 | 36 | alter_ipblocks(); |
| 37 | +initialiseMessages(); |
36 | 38 | |
37 | 39 | # |
38 | 40 | # Run ALTER TABLE queries. |