SAAS-83: Add ability to install Airtime components separately

-fixed
This commit is contained in:
Martin Konecny 2011-11-30 17:59:00 -05:00
parent 05dea59e55
commit c48154ef2f
7 changed files with 195 additions and 154 deletions

View file

@ -9,51 +9,32 @@
* choose -r to reinstall.
*
* Returns 0 if Airtime is not installed
* Returns 1 if a previous version of Airtime installed
* Returns 2 if the same version of Airtime is installed
* Returns 3 if a version of Airtime that we can't upgrade from is installed.
* Returns 4 if we need to print help message.
* Returns 5 if we need should only install apache files (web-only).
* Returns 1 if the same version of Airtime already installed
* Returns 2 if a previous version of Airtime is installed we can upgrade from
* Returns 3 if a version of Airtime is installed that we can't upgrade from.
*/
require_once(dirname(__FILE__).'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php');
AirtimeInstall::ExitIfNotRoot();
$opts = AirtimeInstall::getOpts();
if (is_null($opts)) {
exit(0);
}
if (isset($opts->h)) {
AirtimeInstall::printUsage($opts);
exit(4);
}
//install media-monitor
if (isset($opts->w)){
exit(5);
}
$version = AirtimeInstall::GetVersionInstalled();
// The current version is already installed.
echo "* Checking for existing install of Airtime...".PHP_EOL;
if (isset($version) && ($version != false)){
if (($version == AIRTIME_VERSION) && !isset($opts->r)) {
echo "Airtime $version is already installed.".PHP_EOL;
AirtimeInstall::printUsage($opts);
exit(2);
} else if (strcmp($version, AIRTIME_VERSION) < 0){
echo " * Found previous version: $version".PHP_EOL;
exit(1);
if (isset($version)){
if ($version === false){
//version of Airtime older than 1.7.0 detected
exit(3);
} else {
if (($version == AIRTIME_VERSION)) {
//same version of Airtime is already installed
exit(1);
} else if (strcmp($version, AIRTIME_VERSION) < 0){
//previous version of Airtime is installed.
exit(2);
}
}
} else {
echo " * Not Found".PHP_EOL;
}
if($version === false){
echo "A version of Airtime older than 1.7.0 detected, please upgrade to 1.7.0 first.\n";
echo "You will then be able to upgrade to 1.9.0 using this installer.\n";
exit(3);
//no previous version of Airtime found
exit(0);
}