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
|
@ -68,7 +68,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
|
||||
protected function _initHeadLink()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$view = $this->getResource('view');
|
||||
|
||||
|
@ -85,7 +85,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
|
||||
protected function _initHeadScript()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$view = $this->getResource('view');
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ class Config {
|
|||
|
||||
$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
|
||||
$CC_CONFIG['basePort'] = $values['general']['base_port'];
|
||||
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
|
||||
|
||||
$CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours'];
|
||||
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
* yet available because airtime.conf hasn't been updated yet. This situation ends up throwing a lot of errors to stdout.
|
||||
* airtime*/
|
||||
|
||||
global $CC_CONFIG;
|
||||
require_once("conf.php");
|
||||
|
||||
$filename = "/etc/airtime/airtime.conf";
|
||||
$values = parse_ini_file($filename, true);
|
||||
|
||||
// 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']['phptype'] = 'pgsql';
|
||||
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
|
|
@ -48,7 +48,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
public function checkAuth()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$api_key = $this->_getParam('api_key');
|
||||
|
||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]) &&
|
||||
|
|
|
@ -19,7 +19,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
*/
|
||||
public function audioPreviewAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$audioFileID = $this->_getParam('audioFileID');
|
||||
$audioFileArtist = $this->_getParam('audioFileArtist');
|
||||
|
@ -73,7 +73,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
*/
|
||||
public function playlistPreviewAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$playlistIndex = $this->_getParam('playlistIndex');
|
||||
$playlistID = $this->_getParam('playlistID');
|
||||
|
@ -99,7 +99,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
public function blockPreviewAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$blockIndex = $this->_getParam('blockIndex');
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
@ -226,7 +226,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
*/
|
||||
public function showPreviewAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$showID = $this->_getParam('showID');
|
||||
$showIndex = $this->_getParam('showIndex');
|
||||
|
|
|
@ -96,7 +96,7 @@ class DashboardController extends Zend_Controller_Action
|
|||
|
||||
public function streamPlayerAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
|
|
@ -12,7 +12,7 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
|
|
@ -9,7 +9,7 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
@ -102,7 +102,7 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
public function passwordRestoreAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$locale = Application_Model_Preference::GetLocale();
|
||||
|
|
|
@ -20,7 +20,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
@ -80,7 +80,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function supportSettingAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
@ -136,7 +136,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function directoryConfigAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||
|
||||
|
@ -153,7 +153,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function streamSettingAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
|
|
@ -19,7 +19,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
public function indexAction()
|
||||
{
|
||||
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
public function addUserAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
@ -48,8 +48,8 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
if ($form->isValid($formData)) {
|
||||
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['login'] == 'admin'
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['login'] == 'admin'
|
||||
&& $formData['user_id'] != 0) {
|
||||
$this->view->form = $form;
|
||||
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||
|
@ -131,12 +131,12 @@ class UserController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['cu_login'] == 'admin') {
|
||||
$this->view->form = $form;
|
||||
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||
die(json_encode(array("html"=>$this->view->render('user/edit-user.phtml'))));
|
||||
} else if ($form->isValid($formData) &&
|
||||
} else if ($form->isValid($formData) &&
|
||||
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||
$user = new Application_Model_User($formData['cu_user_id']);
|
||||
$user->setFirstName($formData['cu_first_name']);
|
||||
|
@ -186,7 +186,7 @@ class UserController extends Zend_Controller_Action
|
|||
# only delete when valid action is selected for the owned files
|
||||
if (! in_array($files_action, $valid_actions) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$userId = $userInfo->id;
|
||||
|
|
|
@ -5,7 +5,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
public function init()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
|
||||
|
||||
|
@ -131,7 +131,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
public function updateVariables()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||
|
|
|
@ -5,7 +5,7 @@ class Application_Form_Login extends Zend_Form
|
|||
|
||||
public function init()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
// Set the method for the display form to POST
|
||||
$this->setMethod('post');
|
||||
|
|
|
@ -15,7 +15,7 @@ class Application_Model_RabbitMq
|
|||
|
||||
private static function sendMessage($exchange, $data)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
|
||||
$CC_CONFIG["rabbitmq"]["port"],
|
||||
|
|
|
@ -763,7 +763,7 @@ SQL;
|
|||
|
||||
private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
/* if $p_fromDateTime and $p_toDateTime function parameters are null,
|
||||
then set range * from "now" to "now + 24 hours". */
|
||||
|
|
|
@ -189,7 +189,7 @@ SQL;
|
|||
->find($con);
|
||||
|
||||
/* Check two things:
|
||||
1. If the show being resized and any of its repeats end in the past
|
||||
1. If the show being resized and any of its repeats end in the past
|
||||
2. If the show being resized and any of its repeats overlap
|
||||
with other scheduled shows */
|
||||
|
||||
|
@ -321,7 +321,7 @@ SQL;
|
|||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ SQL;
|
|||
$startDateTime = new DateTime($show["starts"], $utc);
|
||||
$startDateTime->setTimezone($dtz);
|
||||
|
||||
$rebroadcastsLocal[$i]["start_date"] =
|
||||
$rebroadcastsLocal[$i]["start_date"] =
|
||||
$startDateTime->format("Y-m-d");
|
||||
$rebroadcastsLocal[$i]["start_time"] =
|
||||
$startDateTime->format("H:i");
|
||||
|
@ -533,7 +533,7 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow))
|
||||
if (!is_null($showDaysRow))
|
||||
return $showDaysRow->getDbRepeatType();
|
||||
else
|
||||
return -1;
|
||||
|
@ -582,7 +582,7 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
AND show_id = :showId
|
||||
SQL;
|
||||
Application_Common_Database::prepareAndExecute( $sql,
|
||||
array( ':timestamp' => gmdate("Y-m-d H:i:s"),
|
||||
array( ':timestamp' => gmdate("Y-m-d H:i:s"),
|
||||
':showId' => $this->getId()), 'execute');
|
||||
}
|
||||
|
||||
|
@ -838,7 +838,7 @@ WHERE show_id = :show_id
|
|||
AND ends > :timestamp::TIMESTAMP
|
||||
SQL;
|
||||
|
||||
Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
':add_show_duration' => $p_data['add_show_duration'],
|
||||
':show_id' => $p_data['add_show_id'],
|
||||
':timestamp' => $timestamp), "execute");
|
||||
|
@ -1222,12 +1222,12 @@ SQL;
|
|||
SELECT :rebroadcast::date - :start::date
|
||||
SQL;
|
||||
|
||||
$offset_days =
|
||||
$offset_days =
|
||||
Application_Common_Database::prepareAndExecute($sql,
|
||||
array(
|
||||
'rebroadcast' =>
|
||||
'rebroadcast' =>
|
||||
$data["add_show_rebroadcast_date_absolute_$i"],
|
||||
'start' =>
|
||||
'start' =>
|
||||
$data['add_show_start_date']), "column" );
|
||||
|
||||
//$r = $con->query($sql);
|
||||
|
@ -1770,7 +1770,7 @@ SQL;
|
|||
$parentStartsEpoch = intval($parentStartsDT->format("U"));
|
||||
}
|
||||
|
||||
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$show["starts"],$utc);
|
||||
$endsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$show["ends"], $utc);
|
||||
|
@ -1907,7 +1907,7 @@ SQL;
|
|||
*/
|
||||
public static function getCurrentShow($timeNow=null)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$con = Propel::getConnection();
|
||||
if ($timeNow == null) {
|
||||
$date = new Application_Common_DateHelper;
|
||||
|
@ -1953,7 +1953,7 @@ SQL;
|
|||
*/
|
||||
public static function getPrevCurrentNext($p_timeNow)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$con = Propel::getConnection();
|
||||
//
|
||||
//TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin
|
||||
|
|
|
@ -7,7 +7,7 @@ class Application_Model_Soundcloud
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$this->_soundcloud = new Services_Soundcloud(
|
||||
$CC_CONFIG['soundcloud-client-id'],
|
||||
$CC_CONFIG['soundcloud-client-secret']);
|
||||
|
@ -25,11 +25,11 @@ class Application_Model_Soundcloud
|
|||
|
||||
public function uploadTrack($filepath, $filename, $description,
|
||||
$tags=array(), $release=null, $genre=null)
|
||||
{
|
||||
{
|
||||
|
||||
if (!$this->getToken()) {
|
||||
throw new NoSoundCloundToken();
|
||||
}
|
||||
}
|
||||
if (count($tags)) {
|
||||
$tags = join(" ", $tags);
|
||||
$tags = $tags." ".Application_Model_Preference::GetSoundCloudTags();
|
||||
|
@ -88,7 +88,7 @@ class Application_Model_Soundcloud
|
|||
|
||||
}
|
||||
|
||||
public static function uploadSoundcloud($id)
|
||||
public static function uploadSoundcloud($id)
|
||||
{
|
||||
$cmd = "/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &";
|
||||
Logging::info("Uploading soundcloud with command: $cmd");
|
||||
|
|
|
@ -504,7 +504,7 @@ SQL;
|
|||
*/
|
||||
public function getFileUrlUsingConfigAddress()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
if (isset($CC_CONFIG['baseUrl'])) {
|
||||
$serverName = $CC_CONFIG['baseUrl'];
|
||||
|
@ -1218,7 +1218,7 @@ SQL;
|
|||
// note: never call this method from controllers because it does a sleep
|
||||
public function uploadToSoundCloud()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$file = $this->_file;
|
||||
if (is_null($file)) {
|
||||
|
|
|
@ -5,7 +5,7 @@ class Application_Model_Systemstatus
|
|||
|
||||
public static function GetMonitStatus($p_ip)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$monit_user = $CC_CONFIG['monit_user'];
|
||||
$monit_password = $CC_CONFIG['monit_password'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue