CC-2410: Clean up install process
-fixed missing DB::connect
This commit is contained in:
parent
f755e41a9a
commit
2efe2e67a8
4 changed files with 9 additions and 12 deletions
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
set_include_path(__DIR__.'/../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/constants.php');
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
|
||||
echo PHP_EOL."*** Database Installation ***".PHP_EOL;
|
||||
|
||||
AirtimeInstall::CreateDatabaseUser();
|
||||
|
||||
$databaseExisted = AirtimeInstall::CreateDatabase();
|
||||
|
||||
AirtimeInstall::DbConnect(true);
|
||||
|
||||
AirtimeInstall::InstallPostgresScriptingLanguage();
|
||||
|
||||
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.
|
||||
|
||||
$userAnswer = "x";
|
||||
while (!in_array($userAnswer, array("y", "Y", "n", "N", ""))) {
|
||||
echo PHP_EOL."Database already exists. Do you want to delete all tables and recreate? (y/N)";
|
||||
$userAnswer = trim(fgets(STDIN));
|
||||
}
|
||||
if (in_array($userAnswer, array("y", "Y"))) {
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Database was just created, meaning the tables do not
|
||||
//exist. Let's create them.
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
}
|
||||
|
||||
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue