<?php
/**
- * This is a class used to hold configuration settings, particularly for multi-wiki sites.
+ * This is a class used to hold configuration settings, particularly for multi-wiki sites.
*
* @package MediaWiki
*/
/**
- * The include paths change after this file is included from commandLine.inc,
+ * The include paths change after this file is included from commandLine.inc,
* meaning that require_once() fails to detect that it is including the same
* file again. We use DIY C-style protection as a workaround.
*/
var $suffixes = array();
var $wikis = array();
var $settings = array();
- var $localDatabases = array();
var $localVHosts = array();
- /** */
+ /** */
function get( $setting, $wiki, $suffix, $params = array() ) {
if ( array_key_exists( $setting, $this->settings ) ) {
if ( array_key_exists( $wiki, $this->settings[$setting] ) ) {
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 ));
/** */
function &getLocalDatabases() {
- return $this->localDatabases;
+ return $this->wikis;
}
/** */
function initialise() {
- foreach ( $this->wikis as $db ) {
- $this->localDatabases[$db] = $db;
- }
}
/** */
}
}
}
-
+
?>