CC-2281 Install script should check for pre-installed versions and prompt user to upgrade/full installation

Bypass choice to keep database if it's a fresh install.
This commit is contained in:
Naomi 2011-05-19 15:33:48 -04:00
parent 5e02a46a24
commit 3e2e62afe9
2 changed files with 12 additions and 5 deletions

View File

@ -18,7 +18,10 @@ AirtimeInstall::DbConnect(true);
AirtimeInstall::InstallPostgresScriptingLanguage();
if ($databaseExisted){
if(isset($argv[1]) && $argv[1] == 'y') {
AirtimeInstall::CreateDatabaseTables();
}
else if ($databaseExisted){
//Database already exists. Ask the user how they want to
//proceed. Warn them that creating the database tables again
//will cause them to lose their old ones.
@ -31,7 +34,8 @@ if ($databaseExisted){
if (in_array($userAnswer, array("y", "Y"))) {
AirtimeInstall::CreateDatabaseTables();
}
} else {
}
else {
//Database was just created, meaning the tables do not
//exist. Let's create them.
AirtimeInstall::CreateDatabaseTables();

View File

@ -118,7 +118,12 @@ require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php')
echo "* Airtime Version: ".AIRTIME_VERSION.PHP_EOL;
if ($db_install) {
require( 'airtime-db-install.php' );
if($turnOffPreserve) {
system('php airtime-db-install.php y');
}
else {
system('php airtime-db-install.php');
}
}
AirtimeInstall::InstallStorageDirectory();
@ -139,7 +144,5 @@ system("python ".__DIR__."/../python_apps/show-recorder/install/recorder-install
//echo PHP_EOL."*** Media Monitor Installation ***".PHP_EOL;
//system("python ".__DIR__."/../python_apps/pytag-fs/install/media-monitor-install.py");
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
echo "******************************* Install Complete *******************************".PHP_EOL;