[mapguide-commits] r8170 - trunk/MgDev/UnitTest
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon May 26 23:10:21 PDT 2014
Author: jng
Date: 2014-05-26 23:10:21 -0700 (Mon, 26 May 2014)
New Revision: 8170
Modified:
trunk/MgDev/UnitTest/prepare.php
Log:
Fix prepare.php to not use realpath() and to be smarter when doing find/replace
Modified: trunk/MgDev/UnitTest/prepare.php
===================================================================
--- trunk/MgDev/UnitTest/prepare.php 2014-05-27 04:50:06 UTC (rev 8169)
+++ trunk/MgDev/UnitTest/prepare.php 2014-05-27 06:10:21 UTC (rev 8170)
@@ -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