1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-02 12:47:31 +02: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']; $this->config = $GLOBALS['config'];
//Get config from enviroment //Get config from enviroment
if(isset($_ENV['serverTitle'])){ $envServerTitle = getenv('serverTitle');
$this->config['serverTitle'] = $_ENV['serverTitle']; if($envServerTitle !== FALSE){
$this->config['serverTitle'] = $envServerTitle;
} }
if(isset($_ENV['baseUrls'])){ $envBaseUrls = getenv('baseUrls');
$this->config['baseUrls'] = is_array($_ENV['baseUrls']) ? if($envBaseUrls !== FALSE){
$_ENV['baseUrls'] : explode(',', $_ENV['baseUrls']); $this->config['baseUrls'] = is_array($envBaseUrls) ?
$envBaseUrls : explode(',', $envBaseUrls);
} }
} }