1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-01-17 14:18:19 +01:00

Config from eniviroment if is provided

This commit is contained in:
Dalibor Janák 2016-03-01 15:05:58 +01:00
parent 50630fe1c7
commit 8bbfa1d367

View File

@ -62,10 +62,16 @@ class Server {
* Set config
*/
public function __construct() {
//Get config from docker volumes
$envConfig = $_ENV['config'] == null ? array() : $_ENV['config'];
$this->config = array_merge($GLOBALS['config'], $envConfig);
$this->config = $GLOBALS['config'];
//Get config from enviroment
if(isset($_ENV['serverTitle'])){
$this->config['serverTitle'] = $_ENV['serverTitle'];
}
if(isset($_ENV['baseUrls'])){
$this->config['baseUrls'] = is_array($_ENV['baseUrls']) ?
$_ENV['baseUrls'] : explode(',', $_ENV['baseUrls']);
}
}
/**