From 09eaa53177ee57030c8478ea3f017086c938d711 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 4 Jan 2006 22:48:35 +0000 Subject: [PATCH] Simpler structure for wgLocalDatabases, for faster setup. SiteConfiguration::getAll() to get all settings as an array --- includes/DefaultSettings.php | 2 +- includes/SiteConfiguration.php | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f0142eb011..7a38a50b95 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -512,7 +512,7 @@ $wgDBmysql5 = false; /** * Other wikis on this site, can be administered from a single developer * account. - * Array, interwiki prefix => database name + * Array numeric key => database name */ $wgLocalDatabases = array(); diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 89cf746547..6cb645b11a 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -18,7 +18,6 @@ class SiteConfiguration { var $suffixes = array(); var $wikis = array(); var $settings = array(); - var $localDatabases = array(); var $localVHosts = array(); /** */ @@ -45,6 +44,18 @@ class SiteConfiguration { return $retval; } + /** */ + function getAll( $wiki, $suffix, $params ) { + $localSettings = array(); + foreach ( $this->settings as $varname => $stuff ) { + $value = $this->get( $varname, $wiki, $suffix, $params ); + if ( !is_null( $value ) ) { + $localSettings[$varname] = $value; + } + } + return $localSettings; + } + /** */ function getBool( $setting, $wiki, $suffix ) { return (bool)($this->get( $setting, $wiki, $suffix )); @@ -52,14 +63,11 @@ class SiteConfiguration { /** */ function &getLocalDatabases() { - return $this->localDatabases; + return $this->wikis; } /** */ function initialise() { - foreach ( $this->wikis as $db ) { - $this->localDatabases[$db] = $db; - } } /** */ -- 2.20.1