From c4f5f2e8af36d02865809466504445c022df44ab Mon Sep 17 00:00:00 2001 From: mkonecny Date: Wed, 12 Jan 2011 13:25:47 -0500 Subject: [PATCH] -fixed propel-install continuing installation when project.home was incorrectly configured. --- install/propel-install.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/install/propel-install.php b/install/propel-install.php index 8a24e659e..245ee3a3c 100644 --- a/install/propel-install.php +++ b/install/propel-install.php @@ -27,6 +27,29 @@ if(exec("whoami") != "root"){ exit(1); } +// Need to check if build.properties project home is set correctly. + +$property = 'project.home'; +$lines = file('../build/build.properties'); +foreach ($lines as $line) { + if ($property == substr($line, 0, strlen($property))){ + $indexOfEquals = strpos($line, '='); + if ($indexOfEquals !== false){ + $dir_value = trim(substr($line, $indexOfEquals+1)); + //check to make sure that the project.home path is equal to one level + //up of this install script location. + $dir_found = realpath(__dir__.'/../') == realpath($dir_value); + } + break; + } +} + +if ($dir_found === false){ + echo ("../build/build.properties 'project.home' value of '$dir_value' is incorrect. Please correct and try install again.\n"); + exit(1); +} + + echo "******************************* Install Begin ********************************\n"; echo " *** Database Installation ***\n";