* (bug 7460) Revert broken patch for bug 7226 which slows down
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 2 Oct 2006 16:33:14 +0000 (16:33 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 2 Oct 2006 16:33:14 +0000 (16:33 +0000)
  Special:Allmessages by a factor of 16

RELEASE-NOTES
includes/SpecialAllmessages.php

index 9e0f6e9..13096c9 100644 (file)
@@ -249,6 +249,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Add + to $wgLegalTitleChars by default. Some sites may have occasional
   problems with hard-to-reach pages, but it should be less trouble than
   "I can't import dumps from Wikipedia" complaints
+* (bug 7460) Revert broken patch for bug 7226 which slows down
+  Special:Allmessages by a factor of 16
 
 
 == Languages updated ==
index f5e16cf..6e3f658 100644 (file)
@@ -10,7 +10,7 @@
  */
 function wfSpecialAllmessages() {
        global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
-       global $wgUseDatabaseMessages, $wgLang, $wgContLang;
+       global $wgUseDatabaseMessages;
 
        # The page isn't much use if the MediaWiki namespace is not being used
        if( !$wgUseDatabaseMessages ) {
@@ -32,17 +32,11 @@ function wfSpecialAllmessages() {
        $first = true;
        $sortedArray = array_merge( Language::getMessagesFor( 'en' ), $wgMessageCache->getExtensionMessagesFor( 'en' ) );
        ksort( $sortedArray );
-       $contentCode = $wgContLang->getCode();
-       $fallback = Language::getFallbackFor( $wgLang->getCode() );
        $messages = array();
        $wgMessageCache->disableTransform();
 
-       foreach ( array_keys( $sortedArray ) as $key ) {
-               if ( $contentCode == $fallback ) {
-                       $messages[$key]['fallbackmsg'] = wfMsgNoDbForContent( $key );
-               } else {
-                       $messages[$key]['fallbackmsg'] = wfMsgNoDb( "$key/$fallback" );
-               }
+       foreach ( $sortedArray as $key => $value ) {
+               $messages[$key]['enmsg'] = $value;
                $messages[$key]['statmsg'] = wfMsgNoDb( $key );
                $messages[$key]['msg'] = wfMsg ( $key );
        }
@@ -71,7 +65,7 @@ function makePhp($messages) {
        global $wgLang;
        $txt = "\n\n\$messages = array(\n";
        foreach( $messages as $key => $m ) {
-               if($wgLang->getCode() != 'en' and $m['msg'] == $m['fallbackmsg'] ) {
+               if($wgLang->getCode() != 'en' and $m['msg'] == $m['enmsg'] ) {
                        //if (strstr($m['msg'],"\n")) {
                        //      $txt.='/* ';
                        //      $comment=' */';