reloading config after ini values are changed
This commit is contained in:
parent
2c7bf676a3
commit
9e96ec9da4
|
@ -86,4 +86,30 @@ set_include_path('.'.PATH_SEPARATOR.$CC_CONFIG['pearPath']
|
|||
function load_airtime_config(){
|
||||
$ini_array = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
return $ini_array;
|
||||
}
|
||||
|
||||
class Config {
|
||||
public static function reload_config() {
|
||||
global $CC_CONFIG;
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
// Name of the web server user
|
||||
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
|
||||
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
|
||||
|
||||
$CC_CONFIG['baseFilesDir'] = $values['general']['base_files_dir'];
|
||||
// main directory for storing binary media files
|
||||
$CC_CONFIG['storageDir'] = $values['general']['base_files_dir']."/stor";
|
||||
|
||||
// Database config
|
||||
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
|
||||
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
|
||||
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
|
||||
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
|
||||
|
||||
$CC_CONFIG['apiKey'] = array($values['general']['api_key']);
|
||||
|
||||
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
|
||||
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ AirtimeInstall::InstallStorageDirectory();
|
|||
|
||||
AirtimeInstall::ChangeDirOwnerToWebserver($CC_CONFIG["storageDir"]);
|
||||
|
||||
AirtimeInstall::CreateSymlinksToUtils($CC_CONFIG["storageDir"]);
|
||||
AirtimeInstall::CreateSymlinksToUtils();
|
||||
|
||||
echo PHP_EOL."*** Pypo Installation ***".PHP_EOL;
|
||||
system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py");
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Newscoop
|
||||
* @subpackage Subscriptions
|
||||
* @package Airtime
|
||||
* @copyright 2011 Sourcefabric o.p.s.
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
|
|
|
@ -61,6 +61,9 @@ AirtimeInstall::InstallBinaries();
|
|||
|
||||
echo "* Initializing INI files".PHP_EOL;
|
||||
AirtimeIni::UpdateIniFiles();
|
||||
Config::reload_config();
|
||||
|
||||
echo "* Creating default storage directory".PHP_EOL;
|
||||
AirtimeInstall::InstallStorageDirectory();
|
||||
AirtimeInstall::ChangeDirOwnerToWebserver($CC_CONFIG["storageDir"]);
|
||||
AirtimeInstall::CreateSymlinksToUtils();
|
||||
|
|
Loading…
Reference in New Issue