replace TYPE= with ENGINE=, (supported since 4.0, TYPE deprecated since 4.1)
[lhc/web/wiklou.git] / includes / SiteConfiguration.php
index 89cf746..8fd5d6b 100644 (file)
@@ -1,12 +1,12 @@
 <?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.
  */
@@ -18,10 +18,9 @@ class SiteConfiguration {
        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] ) ) {
@@ -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;
-               }
        }
 
        /** */
@@ -109,5 +117,5 @@ class SiteConfiguration {
        }
 }
 }
-       
+
 ?>