Wrapper around Symfony's Yaml parser - added __DIR__
support.
{
"require": {
"heartsentwined/yaml": "1.*"
}
}
Two constants added:
__DIR__
: behave as expected___DIR___
(an extra underscore around): literal__DIR__
Parse a Yaml file foo/bar.yml
:
use Heartsentwined\Yaml\Yaml;
$parsedArray = Yaml::parse('foo/bar.yml');
Parse a Yaml string foo: bar
(of course, neither __DIR__
nor ___DIR___
would be available)
use Heartsentwined\Yaml\Yaml;
$parsedArray = Yaml::parse('foo: bar');