Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To use Yaml instead of JSON, just pass a file that ends on `.yml`:

$app->register(new Igorw\Silex\ConfigServiceProvider(__DIR__."/../config/services.yml"));

Note, you will have to require the `~2.1` of the `symfony/yaml` package.
Note, you will have to require the `~2.2` of the `symfony/yaml` package.

### Using TOML

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"silex/silex": "~1.0"
},
"require-dev": {
"symfony/yaml": "~2.1",
"symfony/yaml": "~2.2",
"jamesmoss/toml": "~0.1"
},
"suggest": {
"symfony/yaml": "~2.1",
"symfony/yaml": "~2.2",
"jamesmoss/toml": "~0.1"
},
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion src/Igorw/Silex/YamlConfigDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public function load($filename)
if (!class_exists('Symfony\\Component\\Yaml\\Yaml')) {
throw new \RuntimeException('Unable to read yaml as the Symfony Yaml Component is not installed.');
}
$config = Yaml::parse($filename);

$input = file_get_contents($filename);
$config = Yaml::parse($input);
return $config ?: array();
}

Expand Down