2017 © Pedro Peláez
 

library config-yaml-reader

A yaml reader for the maer/config library

image

maer/config-yaml-reader

A yaml reader for the maer/config library

  • Thursday, April 12, 2018
  • by maer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yaml reader for maer/config

Build Status, (*1)

To keep the maer/config library small and without dependencies, it doesn't support yaml-files out of the box., (*2)

If you want to use yaml-files, you can install this reader and register it for the yaml-file extension. This extension requires you to use maer/config version 2+., (*3)

Install

composer require maer/config-yaml-reader

If maer/config wasn't installed before, it will also be installed., (*4)

Register

You need to register the reader and associate it with the yml-file extension., (*5)

# Either add the reader to an existing config instance
$config->setReader('yml', new Maer\Config\Yaml\Reader);

# or you can add the reader when you instantiate the config class as a second argument
$options = [
    'readers' => [
        'yml' => new Maer\Config\Yaml\Reader,
    ],
];

$config = new Config(['/path-to-your-config.yml'], $options);

If you go for the first option, you need to set the reader before you load the yaml-file., (*6)

Exceptions

If the yaml file couldn't be parsed, it will throw a Symfony\Component\Yaml\Exception\ParseException., (*7)

The Versions

12/04 2018

dev-develop

dev-develop

A yaml reader for the maer/config library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Magnus Eriksson