* Indenting and formatting.
[lhc/web/wiklou.git] / includes / SiteConfiguration.php
index 211e0a4..1abe48d 100644 (file)
@@ -1,8 +1,24 @@
 <?php
+/**
+ *This file is used to configure the live Wikimedia wikis. The file that
+ * includes it contains passwords and other sensitive data, and there's
+ * currently no public equivalent.
+ *
+ * @package MediaWiki
+ */
 
-# This file is used to configure the live Wikimedia wikis. The file that includes
-# it contains passwords and other sensitive data, and there's currently no public
-# equivalent. 
+/**
+ *
+ * @package MediaWiki
+ */
+
+/**
+ * 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.
+ */
+if (!defined('SITE_CONFIGURATION')) {
+define('SITE_CONFIGURATION', 1);
 
 class SiteConfiguration {
        var $suffixes, $wikis, $settings;
@@ -13,7 +29,7 @@ class SiteConfiguration {
                        $retval = $this->settings[$setting][$wiki];
                } elseif ( array_key_exists( $suffix, $this->settings[$setting] ) ) {
                        $retval = $this->settings[$setting][$suffix];
-               } elseif ( array_key_exists( "default", $this->settings[$setting] ) ) {
+               } elseif ( array_key_exists( 'default', $this->settings[$setting] ) ) {
                        $retval = $this->settings[$setting]['default'];
                } else {
                        $retval = NULL;
@@ -60,7 +76,10 @@ class SiteConfiguration {
                }
        }
 
-       # Work out the site and language name from a database name
+       /**
+        * Work out the site and language name from a database name
+        * @param $db
+        */
        function siteFromDB( $db ) {
                $site = NULL;
                $lang = NULL;
@@ -74,6 +93,6 @@ class SiteConfiguration {
                return array( $site, $lang );
        }
 }
-
+}
        
 ?>