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

moving constants in conf.php to constants.php
This commit is contained in:
Naomi 2011-05-19 14:27:30 -04:00
parent e7589f6007
commit a2ec9b4d10
5 changed files with 11 additions and 9 deletions

View File

@ -6,10 +6,6 @@
* /etc/airtime/recorder.cfg
*/
define('AIRTIME_VERSION', '1.8.2');
define('AIRTIME_COPYRIGHT_DATE', '2010-2011');
define('AIRTIME_REST_VERSION', '1.1');
global $CC_CONFIG;
$CC_CONFIG = array(

View File

@ -1,5 +1,9 @@
<?php
define('AIRTIME_VERSION', '1.8.2');
define('AIRTIME_COPYRIGHT_DATE', '2010-2011');
define('AIRTIME_REST_VERSION', '1.1');
// Metadata Keys
define('UI_MDATA_KEY_TITLE', 'dc:title');
define('UI_MDATA_KEY_CREATOR', 'dc:creator');

View File

@ -5,6 +5,7 @@ set_include_path(__DIR__.'/../airtime_mvc/library' . PATH_SEPARATOR . get_includ
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;
@ -21,7 +22,7 @@ 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)";

View File

@ -11,12 +11,15 @@ echo "******************************** Install Begin ***************************
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/constants.php');
AirtimeInstall::ExitIfNotRoot();
$version = AirtimeInstall::CheckForVersionBeforeInstall();
require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
//a previous version exists.
if(isset($version) && $version != false && $version < AIRTIME_VERSION) {
@ -47,9 +50,6 @@ if(isset($version) && $version != false && $version < AIRTIME_VERSION) {
}
}
require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
try {
$opts = new Zend_Console_Getopt(
array(

View File

@ -15,6 +15,7 @@ if (!file_exists(AirtimeIni::CONF_FILE_AIRTIME)) {
echo "Most likely this means that Airtime is not installed, so there is nothing to do.".PHP_EOL.PHP_EOL;
exit();
}
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/constants.php');
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
echo PHP_EOL;