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");
}
throw new MWException( "Bad lang code $langcode given" );
}
- $langcode = $lang->getCode();
+ $langcode = $lang->getCodeForMessage();
$message = false;
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;
}
}