From: Kevin Israel Date: Thu, 8 Oct 2015 20:29:16 +0000 (-0400) Subject: LocalisationCache::recache(): Use array_fill_keys() X-Git-Tag: 1.31.0-rc.0~9461^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=fd7a480402c90ea62941d1db6ef4dbc7e9061390;p=lhc%2Fweb%2Fwiklou.git LocalisationCache::recache(): Use array_fill_keys() LocalisationCache was added in 1.16, so in order to retain PHP 5.1 compatibility, array_fill_keys() was avoided. In 1.17, support for PHP 5.1 was dropped, so we can use that function now. Change-Id: I435705639f1a470324a4ba46153351aadc0d40e2 --- diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index f5b235055e..fa5e288f8a 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -816,9 +816,7 @@ class LocalisationCache { $this->recachedLangs[$code] = true; # Initial values - $initialData = array_combine( - self::$allKeys, - array_fill( 0, count( self::$allKeys ), null ) ); + $initialData = array_fill_keys( self::$allKeys, null ); $coreData = $initialData; $deps = array(); @@ -856,9 +854,7 @@ class LocalisationCache { $messageDirs = $this->getMessagesDirs(); # Load non-JSON localisation data for extensions - $extensionData = array_combine( - $codeSequence, - array_fill( 0, count( $codeSequence ), $initialData ) ); + $extensionData = array_fill_keys( $codeSequence, $initialData ); foreach ( $wgExtensionMessagesFiles as $extension => $fileName ) { if ( isset( $messageDirs[$extension] ) ) { # This extension has JSON message data; skip the PHP shim