Skip to content
Wrapper around Symfony's Yaml parser - added __DIR__ support.
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src/Heartsentwined/Yaml
test
.gitignore
.travis.yml
README.md
composer.json

README.md

Heartsentwined\Yaml

Build Status

Wrapper around Symfony's Yaml parser - added __DIR__ support.

Installation

Composer:

{
    "require": {
        "heartsentwined/yaml": "1.*"
    }
}

Usage

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');
Something went wrong with that request. Please try again.