- temp commit
This commit is contained in:
parent
dcf3526000
commit
a55bc9973c
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
require_once __DIR__."/configs/conf.php";
|
require_once __DIR__."/configs/conf.php";
|
||||||
|
Config::loadConfig();
|
||||||
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
require_once __DIR__."/configs/ACL.php";
|
require_once __DIR__."/configs/ACL.php";
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
|
|
||||||
|
@ -20,13 +23,11 @@ require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
require_once (APPLICATION_PATH."/logging/Logging.php");
|
require_once (APPLICATION_PATH."/logging/Logging.php");
|
||||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||||
|
Logging::info($CC_CONFIG);
|
||||||
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
||||||
|
|
||||||
global $CC_CONFIG;
|
Config::setAirtimeVersion();
|
||||||
$airtime_version = Application_Model_Preference::GetAirtimeVersion();
|
$CC_CONFIG = Config::getConfig();
|
||||||
$uniqueid = Application_Model_Preference::GetUniqueId();
|
|
||||||
$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid);
|
|
||||||
require_once __DIR__."/configs/navigation.php";
|
require_once __DIR__."/configs/navigation.php";
|
||||||
|
|
||||||
Zend_Validate::setDefaultNamespaces("Zend");
|
Zend_Validate::setDefaultNamespaces("Zend");
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* that the user can customize these.
|
* that the user can customize these.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$dbhost = $CC_CONFIG['dsn']['hostspec'];
|
$dbhost = $CC_CONFIG['dsn']['hostspec'];
|
||||||
$dbname = $CC_CONFIG['dsn']['database'];
|
$dbname = $CC_CONFIG['dsn']['database'];
|
||||||
|
|
|
@ -6,29 +6,20 @@
|
||||||
* /etc/airtime/recorder.cfg
|
* /etc/airtime/recorder.cfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
global $CC_CONFIG;
|
class Config {
|
||||||
|
private static $CC_CONFIG;
|
||||||
$CC_CONFIG = array(
|
public static function loadConfig() {
|
||||||
// prefix for table names in the database
|
$CC_CONFIG = array(
|
||||||
'tblNamePrefix' => 'cc_',
|
|
||||||
|
|
||||||
/* ================================================ storage configuration */
|
/* ================================================ storage configuration */
|
||||||
|
|
||||||
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
|
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
|
||||||
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
|
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
|
||||||
|
|
||||||
"rootDir" => __DIR__."/../.."
|
"rootDir" => __DIR__."/../.."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
||||||
|
|
||||||
$configFile = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
|
||||||
Config::loadConfig($configFile);
|
|
||||||
|
|
||||||
class Config {
|
|
||||||
public static function loadConfig($p_path) {
|
|
||||||
global $CC_CONFIG;
|
|
||||||
|
|
||||||
$filename = $p_path;
|
|
||||||
$values = parse_ini_file($filename, true);
|
$values = parse_ini_file($filename, true);
|
||||||
|
|
||||||
// Name of the web server user
|
// Name of the web server user
|
||||||
|
@ -62,5 +53,16 @@ class Config {
|
||||||
if(isset($values['demo']['demo'])){
|
if(isset($values['demo']['demo'])){
|
||||||
$CC_CONFIG['demo'] = $values['demo']['demo'];
|
$CC_CONFIG['demo'] = $values['demo']['demo'];
|
||||||
}
|
}
|
||||||
|
self::$CC_CONFIG = $CC_CONFIG;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setAirtimeVersion() {
|
||||||
|
$airtime_version = Application_Model_Preference::GetAirtimeVersion();
|
||||||
|
$uniqueid = Application_Model_Preference::GetUniqueId();
|
||||||
|
self::$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getConfig() {
|
||||||
|
return self::$CC_CONFIG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue