CC-2833: Use ClassLoaders for PHP Files

-autoload RabbitMq class
This commit is contained in:
martin 2011-09-26 15:19:04 -04:00
parent 2c0b0a2eff
commit dfe43c98bb
12 changed files with 35 additions and 35 deletions

View file

@ -19,7 +19,7 @@ require_once 'Soundcloud.php';
require_once 'Preference.php';
//require_once 'Shows.php';
//require_once 'User.php';
require_once 'RabbitMq.php';
//require_once 'RabbitMq.php';
require_once 'DateHelper.php';
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';

View file

@ -164,7 +164,7 @@ class LibraryController extends Zend_Controller_Action
else {
$res = settype($res, "integer");
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
}
}
@ -214,7 +214,7 @@ class LibraryController extends Zend_Controller_Action
$data = $file->getMetadata();
RabbitMq::SendMessageToMediaMonitor("md_update", $data);
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
$this->_helper->redirector('index');
}

View file

@ -188,7 +188,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_StreamSetting::setStreamSetting($values);
$data = array();
$data['setting'] = Application_Model_StreamSetting::getStreamSetting();
RabbitMq::SendMessageToPypo("update_stream_setting", $data);
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
}
}

View file

@ -700,7 +700,7 @@ class ScheduleController extends Zend_Controller_Action
$show->clearShow();
$show->deleteShow();
// send 'cancel-current-show' command to pypo
RabbitMq::SendMessageToPypo("cancel_current_show", array());
Application_Model_RabbitMq::SendMessageToPypo("cancel_current_show", array());
}
}

View file

@ -4,10 +4,10 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopShutdown()
{
if (RabbitMq::$doPush) {
if (Application_Model_RabbitMq::$doPush) {
$md = array('schedule' => Application_Model_Schedule::GetScheduledPlaylists());
RabbitMq::SendMessageToPypo("update_schedule", $md);
RabbitMq::SendMessageToShowRecorder("update_schedule");
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
Application_Model_RabbitMq::SendMessageToShowRecorder("update_schedule");
}
}
}

View file

@ -58,7 +58,7 @@ class Application_Model_MusicDir {
$temp_show->updateScheduledTime();
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
/**
@ -184,7 +184,7 @@ class Application_Model_MusicDir {
$data = array();
$data["directory"] = $p_path;
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
}
return $res;
}
@ -256,7 +256,7 @@ class Application_Model_MusicDir {
$data = array();
$data["directory"] = $p_dir;
$data["dir_id"] = $dirId;
RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
Application_Model_RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
return array("code"=>0);
}else{
return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
@ -289,7 +289,7 @@ class Application_Model_MusicDir {
$dir->remove();
$data = array();
$data["directory"] = $p_dir;
RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);
Application_Model_RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);
return array("code"=>0);
}
}

View file

@ -81,7 +81,7 @@ class Application_Model_Preference
self::SetValue("station_name", $title);
$defaultNamespace = new Zend_Session_Namespace('title_name');
$defaultNamespace->title = $title;
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
//set session variable to new station name so that html title is updated.
//should probably do this in a view helper to keep this controller as minimal as possible.
@ -107,7 +107,7 @@ class Application_Model_Preference
public static function SetStreamLabelFormat($type){
self::SetValue("stream_label_format", $type);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public static function GetStreamLabelFormat(){

View file

@ -9,7 +9,7 @@ class RabbitMq
* Sets a flag to push the schedule at the end of the request.
*/
public static function PushSchedule() {
RabbitMq::$doPush = TRUE;
Application_Model_RabbitMq::$doPush = TRUE;
}
public static function SendMessageToPypo($event_type, $md)

View file

@ -116,7 +116,7 @@ class Application_Model_ScheduleGroup {
}
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
return $this->groupId;
}
@ -155,7 +155,7 @@ class Application_Model_ScheduleGroup {
." WHERE group_id = ".$this->groupId;
//echo $sql;
$retVal = $CC_DBC->query($sql);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
return $retVal;
}

View file

@ -19,7 +19,7 @@ class Application_Model_Show {
{
$show = CcShowQuery::create()->findPK($this->_showId);
$show->setDbName($name);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public function getDescription()
@ -119,7 +119,7 @@ class Application_Model_Show {
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
$CC_DBC->query($sql);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
/**
@ -871,7 +871,7 @@ class Application_Model_Show {
}
Application_Model_Show::populateShowUntil($showId);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
return $showId;
}
@ -1008,7 +1008,7 @@ class Application_Model_Show {
}
}
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
//for a show with repeat_type == 0,1,2
@ -1091,7 +1091,7 @@ class Application_Model_Show {
}
Application_Model_Show::setNextPop($next_date, $show_id, $day);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
private static function populateShow($repeatType, $show_id, $next_pop_date,

View file

@ -111,14 +111,14 @@ class Application_Model_ShowInstance {
{
$this->_showInstance->setDbStarts($start)
->save();
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public function setShowEnd($end)
{
$this->_showInstance->setDbEnds($end)
->save();
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public function updateScheduledTime()
@ -153,7 +153,7 @@ class Application_Model_ShowInstance {
$CC_DBC->query($sql);
}
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public function moveShow($deltaDay, $deltaMin)
@ -219,7 +219,7 @@ class Application_Model_ShowInstance {
$show->setShowLastShow($new_ends);
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
public function resizeShow($deltaDay, $deltaMin)
@ -263,7 +263,7 @@ class Application_Model_ShowInstance {
}
$this->setShowEnd($new_ends);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
}
/**
@ -295,7 +295,7 @@ class Application_Model_ShowInstance {
else {
$groupId = $sched->addPlaylistAfter($this->_instanceId, $lastGroupId, $plId);
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
$this->updateScheduledTime();
}
@ -315,7 +315,7 @@ class Application_Model_ShowInstance {
else {
$groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
}
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
$this->updateScheduledTime();
}
@ -351,7 +351,7 @@ class Application_Model_ShowInstance {
WHERE starts >= '{$groupBoundry["end_timestamp"]}' AND instance_id = {$this->_instanceId}";
$CC_DBC->query($sql);
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
$this->updateScheduledTime();
}
@ -360,7 +360,7 @@ class Application_Model_ShowInstance {
CcScheduleQuery::create()
->filterByDbInstanceId($this->_instanceId)
->delete();
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
$this->updateScheduledTime();
}
@ -373,9 +373,9 @@ class Application_Model_ShowInstance {
CcShowInstancesQuery::create()
->findPK($this->_instanceId)
->delete();
RabbitMq::PushSchedule();
Application_Model_RabbitMq::PushSchedule();
if($recording){
RabbitMq::SendMessageToShowRecorder("cancel_recording");
Application_Model_RabbitMq::SendMessageToShowRecorder("cancel_recording");
}
}

View file

@ -97,9 +97,9 @@ while ($showTime < $endDate) {
$showNumber = $showNumber + 1;
}
if (RabbitMq::$doPush) {
if (Application_Model_RabbitMq::$doPush) {
$md = array('schedule' => Application_Model_Schedule::GetScheduledPlaylists());
RabbitMq::SendMessageToPypo("update_schedule", $md);
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
}