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
|
@ -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