Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
59c1e02a98
|
@ -87,3 +87,29 @@ 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'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,11 +80,11 @@ AirtimeInstall::InstallPostgresScriptingLanguage();
|
|||
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
|
||||
AirtimeInstall::InstallStorageDirectory($CC_CONFIG);
|
||||
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
|
||||
*/
|
||||
|
|
|
@ -91,7 +91,7 @@ class AirtimeInstall
|
|||
chmod($filePath, $fileperms);
|
||||
}
|
||||
|
||||
public static function InstallStorageDirectory($CC_CONFIG)
|
||||
public static function InstallStorageDirectory()
|
||||
{
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
echo "* Storage directory setup".PHP_EOL;
|
||||
|
|
|
@ -48,7 +48,7 @@ $configFiles = array(AirtimeIni::CONF_FILE_AIRTIME,
|
|||
|
||||
foreach ($configFiles as $conf) {
|
||||
if (file_exists($conf)) {
|
||||
echo "Backing up $conf".PHP_EOL;
|
||||
echo "Backing up $conf to $conf.bak".PHP_EOL;
|
||||
exec("cp $conf $conf.bak");
|
||||
}
|
||||
}
|
||||
|
@ -61,3 +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