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

Get global vars via getenv

This commit is contained in:
Dalibor Janák 2016-03-01 19:17:46 +01:00
parent 8bbfa1d367
commit fdeb010831

View File

@ -65,12 +65,14 @@ class Server {
$this->config = $GLOBALS['config'];
//Get config from enviroment
if(isset($_ENV['serverTitle'])){
$this->config['serverTitle'] = $_ENV['serverTitle'];
$envServerTitle = getenv('serverTitle');
if($envServerTitle !== FALSE){
$this->config['serverTitle'] = $envServerTitle;
}
if(isset($_ENV['baseUrls'])){
$this->config['baseUrls'] = is_array($_ENV['baseUrls']) ?
$_ENV['baseUrls'] : explode(',', $_ENV['baseUrls']);
$envBaseUrls = getenv('baseUrls');
if($envBaseUrls !== FALSE){
$this->config['baseUrls'] = is_array($envBaseUrls) ?
$envBaseUrls : explode(',', $envBaseUrls);
}
}