nvanheuverzwijn / php-config-yaml
A yaml configuration reader
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/nvanheuverzwijn/php-config-yaml
Requires
- php: >=5.6.0
- nvanheuverzwijn/php-config: >=0.0.1
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2024-02-04 00:15:59 UTC
README
A yaml configuration parser. This is part of a larger configuration library found here.
Usage
This yaml reader accept a configuration array as an argument. It supports two key: file to specify a yml file to read and yaml_parser to specify a callable function that parse yaml.
Directly using this reader like this.
$reader = new Yaml\Reader([
    'file' => '/some/file.yml',
    'yaml_parser' => '\Symfony\Component\Yaml\Yaml::parse'
]);
$array = $reader->fetchAll();
Use this reader with \Zwijn\Config.
$conf = \Zwijn\Config\ConfigFactory::fromArray([
    'reader' => [
        [
            'class' => '\Zwijn\Config\Yaml\Reader'
            'config' => [
                'file' => '/some/file.yml',
                'yaml_parser' => '\Symfony\Component\Yaml\Yaml::parse'
            ]
        ]
    ]
]);
Dependency
make composer
Test
make test