CC-3786: "airtime-install -r" doesnt prompt if you want to overwrite config files or overwrite database
-fixed
This commit is contained in:
parent
7376e16077
commit
0434ffc7bf
|
@ -6,26 +6,25 @@
|
||||||
*/
|
*/
|
||||||
require_once(__DIR__.'/AirtimeIni.php');
|
require_once(__DIR__.'/AirtimeIni.php');
|
||||||
require_once(__DIR__.'/AirtimeInstall.php');
|
require_once(__DIR__.'/AirtimeInstall.php');
|
||||||
require_once(__DIR__.'/airtime-constants.php');
|
require_once(__DIR__.'/airtime-constants.php');
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
|
||||||
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
|
||||||
|
|
||||||
$version = AirtimeInstall::GetVersionInstalled();
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// The only way we get here is if we are doing a new install or a reinstall.
|
// The only way we get here is if we are doing a new install or a reinstall.
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
$newInstall = false;
|
$iniExists = file_exists("/etc/airtime/airtime.conf");
|
||||||
if (is_null($version)) {
|
if ($iniExists){
|
||||||
|
//reinstall, Will ask if we should rewrite config files.
|
||||||
|
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||||
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
|
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||||
|
$version = AirtimeInstall::GetVersionInstalled();
|
||||||
|
$newInstall = is_null($version);
|
||||||
|
} else {
|
||||||
|
//create config files without asking
|
||||||
$newInstall = true;
|
$newInstall = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db_install = true;
|
|
||||||
if (getenv("nodb")=="t") {
|
|
||||||
$db_install = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$overwrite = false;
|
$overwrite = false;
|
||||||
if (getenv("overwrite") == "t" || $newInstall == true) {
|
if (getenv("overwrite") == "t" || $newInstall == true) {
|
||||||
$overwrite = true;
|
$overwrite = true;
|
||||||
|
@ -50,24 +49,22 @@ if ($overwrite) {
|
||||||
echo "* Initializing INI files".PHP_EOL;
|
echo "* Initializing INI files".PHP_EOL;
|
||||||
AirtimeIni::UpdateIniFiles();
|
AirtimeIni::UpdateIniFiles();
|
||||||
}
|
}
|
||||||
|
if (!$iniExists){
|
||||||
// Update the build.properties file to point to the correct directory.
|
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||||
//AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
|
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
}
|
||||||
|
|
||||||
echo "* Airtime Version: ".AIRTIME_VERSION.PHP_EOL;
|
echo "* Airtime Version: ".AIRTIME_VERSION.PHP_EOL;
|
||||||
|
|
||||||
AirtimeInstall::InstallStorageDirectory();
|
AirtimeInstall::InstallStorageDirectory();
|
||||||
|
|
||||||
|
$db_install = getenv("nodb")!="t";
|
||||||
if ($db_install) {
|
if ($db_install) {
|
||||||
if($newInstall) {
|
if($newInstall) {
|
||||||
//call external script. "y" argument means force creation of database tables.
|
//call external script. "y" argument means force creation of database tables.
|
||||||
passthru('php '.__DIR__.'/airtime-db-install.php y');
|
passthru('php '.__DIR__.'/airtime-db-install.php y');
|
||||||
//AirtimeInstall::DbConnect(true);
|
|
||||||
} else {
|
} else {
|
||||||
require_once('airtime-db-install.php');
|
require_once('airtime-db-install.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FINISHED AIRTIME PHP INSTALLER */
|
|
||||||
|
|
Loading…
Reference in New Issue