Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2011-11-14 16:23:42 -05:00
commit 00f37296e8
1 changed files with 14 additions and 4 deletions

View File

@ -448,13 +448,23 @@ class Application_Model_StoredFile {
/** /**
* Get the URL to access this file using the server name/address that * Get the URL to access this file using the server name/address that
* is specified in the airtime.conf config file. * is specified in the airtime.conf config file. If either of these is
* not specified, then use values provided by the $_SERVER global variable.
*/ */
public function getFileUrlUsingConfigAddress(){ public function getFileUrlUsingConfigAddress(){
global $CC_CONFIG; global $CC_CONFIG;
if (isset($CC_CONFIG['baseUrl'])){
$serverName = $CC_CONFIG['baseUrl']; $serverName = $CC_CONFIG['baseUrl'];
} else {
$serverName = $_SERVER['SERVER_NAME'];
}
if (isset($CC_CONFIG['basePort'])){
$serverPort = $CC_CONFIG['basePort']; $serverPort = $CC_CONFIG['basePort'];
} else {
$serverPort = $_SERVER['SERVER_PORT'];
}
return $this->constructGetFileUrl($serverName, $serverPort); return $this->constructGetFileUrl($serverName, $serverPort);
} }