Installer can handle exceptions now, also suppress possible permission errors with...
[lhc/web/wiklou.git] / includes / MessageCache.php
index 1e98d5a..1cccf78 100644 (file)
@@ -174,9 +174,9 @@ class MessageCache {
 
                fwrite($file,"<?php\n//$hash\n\n \$this->mCache = array(");
 
-               foreach ($array as $key => $message) {
+               foreach ( $array as $key => $message ) {
                        $key = $this->escapeForScript($key);
-                       $messages = $this->escapeForScript($message);
+                       $message = $this->escapeForScript($message);
                        fwrite($file, "'$key' => '$message',\n");
                }
 
@@ -550,7 +550,7 @@ class MessageCache {
                        throw new MWException( "Bad lang code $langcode given" );
                }
 
-               $langcode = $lang->getCode();
+               $langcode = $lang->getCodeForMessage();
 
                $message = false;
 
@@ -644,23 +644,22 @@ class MessageCache {
                                return false;
                        } elseif( $entry === '!TOO BIG' ) {
                                // Fall through and try invididual message cache below
+                       }
+               } else {
+                       // XXX: This is not cached in process cache, should it?
+                       $message = false;
+                       wfRunHooks('MessagesPreLoad', array( $title, &$message ) );
+                       if ( $message !== false ) {
+                               return $message;
+                       }
 
-                       } else {
-                               // XXX: This is not cached in process cache, should it?
-                               $message = false;
-                               wfRunHooks('MessagesPreLoad', array( $title, &$message ) );
-                               if ( $message !== false ) {
-                                       return $message;
-                               }
-
-                               /* If message cache is in normal mode, it is guaranteed
-                                * (except bugs) that there is always entry (or placeholder)
-                                * in the cache if message exists. Thus we can do minor
-                                * performance improvement and return false early.
-                                */
-                               if ( !$wgAdaptiveMessageCache ) {
-                                       return false;
-                               }
+                       /* If message cache is in normal mode, it is guaranteed
+                        * (except bugs) that there is always entry (or placeholder)
+                        * in the cache if message exists. Thus we can do minor
+                        * performance improvement and return false early.
+                        */
+                       if ( !$wgAdaptiveMessageCache ) {
+                               return false;
                        }
                }