[fusion-commits] r1595 - trunk/common/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Oct 14 11:39:13 EDT 2008


Author: Assefa
Date: 2008-10-14 11:39:12 -0400 (Tue, 14 Oct 2008)
New Revision: 1595

Modified:
   trunk/common/php/Utilities.php
Log:
Remove unnecessary regex replacements done on the config file (#139)

Modified: trunk/common/php/Utilities.php
===================================================================
--- trunk/common/php/Utilities.php	2008-10-14 14:45:30 UTC (rev 1594)
+++ trunk/common/php/Utilities.php	2008-10-14 15:39:12 UTC (rev 1595)
@@ -265,18 +265,19 @@
     if (function_exists('json_decode')) {
         $configFile = realpath(dirname(__FILE__)."/../../config.json");
         if (file_exists($configFile)) {
-            $configStr = file_get_contents($configFile);
+          $configStr = file_get_contents($configFile);
             /* replace single quotes with double quotes */
-            $configStr = str_replace("'", '"', $configStr);
+            //$configStr = str_replace("'", '"', $configStr);
             /* get rid of new lines, it just complicates things */
             $configStr = str_replace("\n", '', $configStr);
             /* get rid of embedded comments */
             $configStr = preg_replace("/\/\*.*\*\//U", "", $configStr);
             /* the regex after this one can't handle http: as a value, so mangle it. */
-            $configStr = preg_replace("/http:/U", "http_", $configStr);
+            //$configStr = preg_replace("/http:/U", "http_", $configStr);
             /* quote unquoted attribute names */
-            $configStr = preg_replace("/[^\"]{1}(\w*):/U", "\"$1\":", $configStr);
+            //$configStr = preg_replace("/[^\"]{1}(\w*):/U", "\"$1\":", $configStr);
             /* decode the whole thing */
+            //echo $configStr;
             $_SESSION['fusionConfig'] = json_decode($configStr, false);
         } else {
           echo "config file not found";
@@ -284,4 +285,4 @@
     }
 }
 
-?>
\ No newline at end of file
+?>



More information about the fusion-commits mailing list