[mapguide-commits] r8166 - branches/2.6/MgDev/UnitTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon May 26 21:17:07 PDT 2014


Author: jng
Date: 2014-05-26 21:17:07 -0700 (Mon, 26 May 2014)
New Revision: 8166

Modified:
   branches/2.6/MgDev/UnitTest/prepare.php
Log:
Fix prepare.php to not use realpath() and to be smarter when doing find/replace

Modified: branches/2.6/MgDev/UnitTest/prepare.php
===================================================================
--- branches/2.6/MgDev/UnitTest/prepare.php	2014-05-27 03:12:19 UTC (rev 8165)
+++ branches/2.6/MgDev/UnitTest/prepare.php	2014-05-27 04:17:07 UTC (rev 8166)
@@ -10,20 +10,24 @@
 }
 if (!file_exists($file)) {
     $src = dirname(__FILE__)."/../Web/src/webconfig.ini";
-    $csMapDir = realpath(dirname(__FILE__)."/../Oem/CsMap/Dictionaries");
-    $resDir = realpath(dirname(__FILE__)."/../Web/src/mapagent/Resources");
+    $csMapDir = dirname(__FILE__)."/../Oem/CsMap/Dictionaries";
+    $resDir = dirname(__FILE__)."/../Common/MapGuideCommon/Resources";
     
     $ini = file($src);
     $newlines = array();
     foreach ($ini as $lineNum => $line) {
         $write = "";
-        if (strpos($line, 'MentorDictionaryPath') !== FALSE)
+        $mdp = strpos($line, 'MentorDictionaryPath');
+        $rp = strpos($line, 'ResourcesPath');
+        if ($mdp !== FALSE && $mdp == 0)
             $write = "MentorDictionaryPath = $csMapDir";
-        else if (strpos($line, 'ResourcesPath') !== FALSE)
+        else if ($rp !== FALSE && $rp == 0)
             $write = "ResourcesPath = $resDir";
         else
-            $write = $line;
-        array_push($newlines, $write);
+            $write = trim($line);
+
+        if ($write != "")
+            array_push($newlines, $write);
     }
     
     file_put_contents($file, implode("\n", $newlines));



More information about the mapguide-commits mailing list