Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 9c7d2f6

Browse files
author
Marc Aschmann
committed
Added filecheck, now loading with file_get_contents before YAML::read()
1 parent 7c3a27d commit 9c7d2f6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Config/AbstractConfig.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,14 @@ public function setConfig($file)
113113
*/
114114
private function readFile($file)
115115
{
116-
if ($this->filecheck && !is_file($file)) {
117-
throw new \InvalidArgumentException(
118-
'Config::Abstract() - Given config file ' . $file . ' does not exist!'
119-
);
116+
if ($this->filecheck) {
117+
if (is_file($file)) {
118+
$file = file_get_contents($file);
119+
} else {
120+
throw new \InvalidArgumentException(
121+
'Config::Abstract() - Given config file ' . $file . ' does not exist!'
122+
);
123+
}
120124
}
121125

122126
return (array)Yaml::parse($file);

0 commit comments

Comments
 (0)