1
0
Fork 0

Initialize config if it does not exist yet

pull/1191/merge
Jordi Boggiano 2012-10-18 18:18:40 +02:00
parent fa89ef75e4
commit cf0753e062
1 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,11 @@ class JsonConfigSource implements ConfigSourceInterface
array_shift($args); array_shift($args);
$fallback = array_pop($args); $fallback = array_pop($args);
$contents = file_get_contents($this->file->getPath()); if ($this->file->exists()) {
$contents = file_get_contents($this->file->getPath());
} else {
$contents = "{\n \"config\": {\n }\n}\n";
}
$manipulator = new JsonManipulator($contents); $manipulator = new JsonManipulator($contents);
// try to update cleanly // try to update cleanly