CC-2972: Find better way to determine domain which pypo should download from.
-Done
This commit is contained in:
parent
38f2290214
commit
d8bcb3f03d
|
@ -63,8 +63,8 @@ class Config {
|
||||||
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
|
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
|
||||||
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
|
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
|
||||||
|
|
||||||
//$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
|
$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
|
||||||
//$CC_CONFIG['basePort'] = $values['general']['base_port'];
|
$CC_CONFIG['basePort'] = $values['general']['base_port'];
|
||||||
|
|
||||||
// Database config
|
// Database config
|
||||||
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
|
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
|
||||||
|
|
|
@ -713,7 +713,7 @@ class Schedule {
|
||||||
foreach ($items as $item)
|
foreach ($items as $item)
|
||||||
{
|
{
|
||||||
$storedFile = StoredFile::Recall($item["file_id"]);
|
$storedFile = StoredFile::Recall($item["file_id"]);
|
||||||
$uri = $storedFile->getFileUrl();
|
$uri = $storedFile->getFileUrlUsingConfigAddress();
|
||||||
|
|
||||||
$starts = Schedule::AirtimeTimeToPypoTime($item["starts"]);
|
$starts = Schedule::AirtimeTimeToPypoTime($item["starts"]);
|
||||||
$medias[$starts] = array(
|
$medias[$starts] = array(
|
||||||
|
|
|
@ -435,14 +435,32 @@ class 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()
|
public function getFileUrl()
|
||||||
{
|
{
|
||||||
$serverName = $_SERVER['SERVER_NAME'];
|
$serverName = $_SERVER['SERVER_NAME'];
|
||||||
$serverPort = $_SERVER['SERVER_PORT'];
|
$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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,6 +15,8 @@ vhost = /
|
||||||
api_key = AAA
|
api_key = AAA
|
||||||
web_server_user = www-data
|
web_server_user = www-data
|
||||||
airtime_dir = x
|
airtime_dir = x
|
||||||
|
base_url = localhost
|
||||||
|
base_port = 80
|
||||||
|
|
||||||
[soundcloud]
|
[soundcloud]
|
||||||
connection_retries = 3
|
connection_retries = 3
|
||||||
|
|
Loading…
Reference in New Issue