Check if config file exists

This commit is contained in:
Pierre Rudloff 2015-12-19 00:58:14 +01:00
parent 73da787f77
commit 6bb36a3212

View file

@ -38,7 +38,9 @@ Class Config
*/
private function __construct()
{
$yaml = Yaml::parse(file_get_contents(__DIR__.'/../config.yml'));
$yamlfile = __DIR__.'/../config.yml';
if (is_file($yamlfile)) {
$yaml = Yaml::parse(file_get_contents($yamlfile));
if (isset($yaml) && is_array($yaml)) {
foreach ($yaml as $param=>$value) {
if (isset($this->$param)) {
@ -46,6 +48,7 @@ Class Config
}
}
}
}
if (getenv('CONVERT')) {
$this->convert = getenv('CONVERT');
}