Check if config file exists
This commit is contained in:
parent
73da787f77
commit
6bb36a3212
1 changed files with 8 additions and 5 deletions
|
@ -38,11 +38,14 @@ Class Config
|
||||||
*/
|
*/
|
||||||
private function __construct()
|
private function __construct()
|
||||||
{
|
{
|
||||||
$yaml = Yaml::parse(file_get_contents(__DIR__.'/../config.yml'));
|
$yamlfile = __DIR__.'/../config.yml';
|
||||||
if (isset($yaml) && is_array($yaml)) {
|
if (is_file($yamlfile)) {
|
||||||
foreach ($yaml as $param=>$value) {
|
$yaml = Yaml::parse(file_get_contents($yamlfile));
|
||||||
if (isset($this->$param)) {
|
if (isset($yaml) && is_array($yaml)) {
|
||||||
$this->$param = $value;
|
foreach ($yaml as $param=>$value) {
|
||||||
|
if (isset($this->$param)) {
|
||||||
|
$this->$param = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue