Merge branch '1.9.1' into devel
Conflicts: airtime_mvc/application/controllers/ScheduleController.php airtime_mvc/application/models/Schedule.php airtime_mvc/application/models/StoredFile.php
This commit is contained in:
commit
5a83c5b81e
7 changed files with 46 additions and 9 deletions
|
@ -489,7 +489,7 @@ class Application_Model_Schedule {
|
|||
foreach ($items as $item)
|
||||
{
|
||||
$storedFile = Application_Model_StoredFile::Recall($item["file_id"]);
|
||||
$uri = $storedFile->getFileUrl();
|
||||
$uri = $storedFile->getFileUrlUsingConfigAddress();
|
||||
|
||||
$starts = Application_Model_Schedule::AirtimeTimeToPypoTime($item["starts"]);
|
||||
$medias[$starts] = array(
|
||||
|
|
|
@ -435,14 +435,32 @@ class Application_Model_StoredFile {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the URL to access this file.
|
||||
* Get the URL to access this file using the server name/address that
|
||||
* this PHP script was invoked through.
|
||||
*/
|
||||
public function getFileUrl()
|
||||
{
|
||||
$serverName = $_SERVER['SERVER_NAME'];
|
||||
$serverPort = $_SERVER['SERVER_PORT'];
|
||||
|
||||
return "http://$serverName:$serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
|
||||
|
||||
return constructGetFileUrl($serverName, $serverPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL to access this file using the server name/address that
|
||||
* is specified in the airtime.conf config file.
|
||||
*/
|
||||
public function getFileUrlUsingConfigAddress(){
|
||||
global $CC_CONFIG;
|
||||
|
||||
$serverName = $CC_CONFIG['baseUrl'];
|
||||
$serverPort = $CC_CONFIG['basePort'];
|
||||
|
||||
return constructGetFileUrl($serverName, $serverPort);
|
||||
}
|
||||
|
||||
private function constructGetFileUrl($p_serverName, $p_serverPort){
|
||||
return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue