mango r200 - trunk/lib



Author: ovitters
Date: Thu Jun  5 07:08:29 2008
New Revision: 200
URL: http://svn.gnome.org/viewvc/mango?rev=200&view=rev

Log:
Retab!


Modified:
   trunk/lib/config.php

Modified: trunk/lib/config.php
==============================================================================
--- trunk/lib/config.php	(original)
+++ trunk/lib/config.php	Thu Jun  5 07:08:29 2008
@@ -52,37 +52,37 @@
         $this->cached_date = time();
     }
 
-	/*
-	 * Read from the configuration file
-	 */
-	function read() {
-		// Identify location of config file
-		$basedir = dirname($_SERVER['DOCUMENT_ROOT']);
-		$configfile = $basedir."/config.xml";
-		if(is_readable("/var/www/mango/config.xml"))
-			$configfile = "/var/www/mango/config.xml";
-		if(is_readable("/etc/mango/config.xml"))
-			$configfile = "/etc/mango/config.xml";
-
-		// Check file exists
-		if(!is_readable($configfile)) {
-			return PEAR::raiseError("Could not find configuration file at '".$configfile."'.");
-		}
-
-		// Parse into DOM into member variables
-		$dom = new DOMDocument();
-		if(!$dom->load($configfile)) {
-			return PEAR::raiseError("Trouble parsing config. Please check it's valid XML (e.g. 'xmllint config.xml').");
-		}
-
-		// Work through the elements
-		$root_node = $dom->firstChild;
-		$nodes = $root_node->childNodes;
-		foreach($nodes as $node)
-			$this->read_from($node);
+    /*
+     * Read from the configuration file
+     */
+    function read() {
+        // Identify location of config file
+        $basedir = dirname($_SERVER['DOCUMENT_ROOT']);
+        $configfile = $basedir."/config.xml";
+        if(is_readable("/var/www/mango/config.xml"))
+            $configfile = "/var/www/mango/config.xml";
+        if(is_readable("/etc/mango/config.xml"))
+            $configfile = "/etc/mango/config.xml";
+
+        // Check file exists
+        if(!is_readable($configfile)) {
+            return PEAR::raiseError("Could not find configuration file at '".$configfile."'.");
+        }
+
+        // Parse into DOM into member variables
+        $dom = new DOMDocument();
+        if(!$dom->load($configfile)) {
+            return PEAR::raiseError("Trouble parsing config. Please check it's valid XML (e.g. 'xmllint config.xml').");
+        }
+
+        // Work through the elements
+        $root_node = $dom->firstChild;
+        $nodes = $root_node->childNodes;
+        foreach($nodes as $node)
+            $this->read_from($node);
 
                 return true;
-	}
+    }
 
     /*
      * Read configuration from given node



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]