CC-4384: Remove annoying usage of $CC_CONFIG
- done
This commit is contained in:
parent
a55bc9973c
commit
5a97fb69f2
30 changed files with 84 additions and 78 deletions
|
@ -126,7 +126,7 @@ class AirtimeInstall
|
|||
*/
|
||||
public static function DbConnect($p_exitOnError = true)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
try {
|
||||
$con = Propel::getConnection();
|
||||
} catch (Exception $e) {
|
||||
|
@ -147,7 +147,7 @@ class AirtimeInstall
|
|||
* install script. */
|
||||
public static function InstallStorageDirectory()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
echo "* Storage directory setup".PHP_EOL;
|
||||
|
||||
$ini = parse_ini_file(__DIR__."/airtime-install.ini");
|
||||
|
@ -183,7 +183,7 @@ class AirtimeInstall
|
|||
|
||||
public static function CreateDatabaseUser()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
echo " * Creating Airtime database user".PHP_EOL;
|
||||
|
||||
|
@ -208,7 +208,7 @@ class AirtimeInstall
|
|||
|
||||
public static function CreateDatabase()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
echo " * Creating Airtime database".PHP_EOL;
|
||||
|
||||
|
@ -412,7 +412,7 @@ class AirtimeInstall
|
|||
|
||||
public static function InstallPhpCode()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
echo "* Installing PHP code to ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL;
|
||||
exec("mkdir -p ".AirtimeInstall::CONF_DIR_WWW);
|
||||
exec("cp -R ".AirtimeInstall::GetAirtimeSrcDir()."/* ".AirtimeInstall::CONF_DIR_WWW);
|
||||
|
@ -461,7 +461,7 @@ class AirtimeInstall
|
|||
}
|
||||
|
||||
public static function CreateZendPhpLogFile(){
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$path = AirtimeInstall::CONF_DIR_LOG;
|
||||
$file = $path.'/zendphp.log';
|
||||
|
|
|
@ -10,6 +10,8 @@ require_once(__DIR__.'/AirtimeInstall.php');
|
|||
require_once(__DIR__.'/airtime-constants.php');
|
||||
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
Config::loadConfig();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||
|
||||
|
@ -24,7 +26,6 @@ AirtimeInstall::DbConnect(true);
|
|||
AirtimeInstall::InstallPostgresScriptingLanguage();
|
||||
|
||||
//Load Database parameters
|
||||
global $CC_CONFIG;
|
||||
$dbuser = $CC_CONFIG['dsn']['username'];
|
||||
$dbpasswd = $CC_CONFIG['dsn']['password'];
|
||||
$dbname = $CC_CONFIG['dsn']['database'];
|
||||
|
|
|
@ -16,6 +16,8 @@ $iniExists = file_exists("/etc/airtime/airtime.conf");
|
|||
if ($iniExists){
|
||||
//reinstall, Will ask if we should rewrite config files.
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
Config::loadConfig();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||
$version = AirtimeInstall::GetVersionInstalled();
|
||||
|
@ -51,6 +53,8 @@ if ($overwrite) {
|
|||
}
|
||||
if (!$iniExists){
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
Config::loadConfig();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@ if (!file_exists(AirtimeIni::CONF_FILE_AIRTIME)) {
|
|||
}
|
||||
require_once(__DIR__.'/airtime-constants.php');
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
Config::loadConfig();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
|
@ -37,6 +39,7 @@ $sql = "SELECT pg_cancel_backend(procpid) FROM pg_stat_activity WHERE datname =
|
|||
$command = "echo \"$sql\" | su postgres -c psql";
|
||||
@exec($command, $output);
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
echo " * Dropping the database '".$CC_CONFIG["dsn"]["database"]."'...".PHP_EOL;
|
||||
|
||||
//dropdb returns 1 if other sessions are using the database, otherwise returns 0
|
||||
|
|
|
@ -36,7 +36,7 @@ $version = AirtimeInstall::GetVersionInstalled();
|
|||
|
||||
echo "******************************** Upgrade Begin *********************************".PHP_EOL;
|
||||
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$user = $CC_CONFIG['dsn']['username'];
|
||||
$password = $CC_CONFIG['dsn']['password'];
|
||||
$host = $CC_CONFIG['dsn']['hostspec'];
|
||||
|
@ -83,11 +83,11 @@ if (strcmp($version, "2.0.3") < 0) {
|
|||
if (strcmp($version, "2.1.0") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.0/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
}
|
||||
if (strcmp($version, "2.1.1") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
}
|
||||
if (strcmp($version, "2.1.2") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php");
|
||||
pause();
|
||||
|
@ -95,13 +95,13 @@ if (strcmp($version, "2.1.2") < 0) {
|
|||
if (strcmp($version, "2.1.3") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.3/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
}
|
||||
if (strcmp($version, "2.2.0") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.0/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
}
|
||||
if (strcmp($version, "2.2.1") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.1/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
}
|
||||
echo "******************************* Upgrade Complete *******************************".PHP_EOL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue