From fd7a480402c90ea62941d1db6ef4dbc7e9061390 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Thu, 8 Oct 2015 16:29:16 -0400 Subject: [PATCH] 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 --- includes/cache/LocalisationCache.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 -- 2.20.1