Pull the logic for Media REST API out of the controller
This commit is contained in:
parent
487ab9bd99
commit
0177e40083
5 changed files with 482 additions and 335 deletions
|
@ -17,4 +17,22 @@ class Application_Common_HTTPHelper
|
|||
$request->getParam("timezone", null)
|
||||
);
|
||||
}
|
||||
|
||||
public static function getStationUrl()
|
||||
{
|
||||
$scheme = "http";
|
||||
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
|
||||
$scheme = "https";
|
||||
}
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = $CC_CONFIG['baseUrl'];
|
||||
$baseDir = $CC_CONFIG['baseDir'];
|
||||
$basePort = $CC_CONFIG['basePort'];
|
||||
if (empty($baseDir)) {
|
||||
$baseDir = "/";
|
||||
}
|
||||
$stationUrl = "$scheme://${baseUrl}:${basePort}${baseDir}";
|
||||
|
||||
return $stationUrl;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue