From 49177388a3861ce72c2f81b7e08b3daf16e50a63 Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Tue, 24 Aug 2010 14:58:35 +0000 Subject: [PATCH] Follow up to r71110, use of static var instead of global var, as suggested by Platonides --- includes/GlobalFunctions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7152cf025b..0b6e8f5d46 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3465,11 +3465,12 @@ function wfArrayMap( $function, $input ) { * @return PackageRepository */ function wfGetRepository() { - global $wgRepository, $wgRepositoryApiLocation; + global $wgRepositoryApiLocation; + static $repository = false; - if ( !isset( $wgRepository ) ) { - $wgRepository = new DistributionRepository( $wgRepositoryApiLocation ); + if ( $repository === false ) { + $repository = new DistributionRepository( $wgRepositoryApiLocation ); } - return $wgRepository; + return $repository; } -- 2.20.1