keiii / yaml-config
YAML config utilize symfony components (The Config Component and The Yaml Component) to provide symfony like configuration for any application.
Installs: 2 523
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^5.5|^7.0
- symfony/config: ^2.3|^3.0
- symfony/yaml: ^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.0
- phpunit/phpunit: ^4.0|^5.0
This package is not auto-updated.
Last update: 2023-03-15 20:04:49 UTC
README
Utilize symfony components (The Config Component and The Yaml Component) to provide symfony like configuration for any application.
Installation
composer require keiii/yaml-config
Config example
# /parameters.yml parameters: db_username: 'root' db_password: 'secret'
# /config/config.env.yml imports: - { resource: '../parameters.yml' } database: username: '%db_username%' password: '%db_password%'
Usage
<?php $loader = \KEIII\YamlConfig\Factory::create( __DIR__.'/config', // configs path ['key' => 'value'], // replacements __DIR__.'/var/cache' // cache path or false ); $config = $loader->load('config.env.yml'); // array