sergiors / config-service-provider
This package is abandoned and no longer maintained.
The author suggests using the sergiors/lullaby package instead.
Load yaml, php, directory config to into your container
2.0.0
2016-05-18 20:39 UTC
Requires
- php: >=5.5
- pimple/pimple: ^3.0
- symfony/config: ^2.8|^3.0
- symfony/dependency-injection: ^2.8|^3.0
Requires (Dev)
- pdepend/pdepend: ~2.0
- phing/phing: ~2.10
- phploc/phploc: ~2.1
- phpmd/phpmd: ~2.2
- phpunit/phpunit: ~4.8
- sebastian/phpcpd: ~2.0
- squizlabs/php_codesniffer: ~2.1
- symfony/yaml: ~2.8|~3.0
README
Install
composer require sergiors/config-service-provider
How to use
Let's imagine you want to load the following yaml file:
imports: - { resource: config.yml } twig.options: debug: false db.options: driver: ~ host: ~ user: ~ password: ~ dbname: ~ routing.options: paths: %root_dir%/app/routing.yml
In your php file
use Sergiors\Silex\Provider\ConfigServiceProvider; $app->register(new ConfigServiceProvider(), [ 'config.filenames' => '%root_dir%/config/config_%env%.yml', 'config.replacements' => [ 'root_dir' => dirname(__DIR__) ] ]); $app['config.initializer']();
Now you can access $app['twig.options']['debug']
and others
License
MIT