CC-2172 : Create Upgrade structure so that a user can upgrade from any version of Airtime properly

This commit is contained in:
Naomi 2011-04-12 12:43:25 -04:00
parent 8f1d9e8d86
commit e56f50e8b2
2 changed files with 20 additions and 2 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.8.0

View File

@ -10,10 +10,27 @@ require_once(dirname(__FILE__).'/include/AirtimeIni.php');
AirtimeIni::ExitIfNotRoot();
if(file_exists(dirname(__FILE__).'/../VERSION')) {
$version = file_get_contents(dirname(__FILE__).'/../VERSION');
echo "Airtime Version: ".$version." ".PHP_EOL;
}
else if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) {
$version = "1.7.0";
echo "Airtime Version: ".$version." ".PHP_EOL;
}
else {
$version = "1.6";
echo "Airtime Version: ".$version." ".PHP_EOL;
}
echo "******************************** Update Begin *********************************".PHP_EOL;
//system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
if(strcmp($version, "1.7.0") < 0) {
system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
}
if(strcmp($version, "1.8.0") < 0) {
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
}
echo "******************************* Update Complete *******************************".PHP_EOL;