mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-01-17 22:28:37 +01:00
Config from eniviroment if is provided
This commit is contained in:
parent
50630fe1c7
commit
8bbfa1d367
@ -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 = $GLOBALS['config'];
|
||||
|
||||
$this->config = array_merge($GLOBALS['config'], $envConfig);
|
||||
//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']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user