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

v2.0.4 2016-07-06 12:21 UTC

This package is not auto-updated.

Last update: 2024-11-09 14:34:55 UTC


README

Build Status

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

Installation

Composer:

{
  "require": {
    "yalesov/yaml": "2.*"
  }
}

Usage

Two constants added:

  • __DIR__: behave as expected
  • ___DIR___ (an extra underscore around): literal __DIR__

Parse a Yaml file foo/bar.yml:

use Yalesov\Yaml\Yaml;
$parsedArray = Yaml::parse('foo/bar.yml');

Parse a Yaml string foo: bar (of course, neither __DIR__ nor ___DIR___ would be available)

use Yalesov\Yaml\Yaml;
$parsedArray = Yaml::parse('foo: bar');