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
|
* Set config
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
//Get config from docker volumes
|
$this->config = $GLOBALS['config'];
|
||||||
$envConfig = $_ENV['config'] == null ? array() : $_ENV['config'];
|
|
||||||
|
//Get config from enviroment
|
||||||
$this->config = array_merge($GLOBALS['config'], $envConfig);
|
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