malotor / config-provider
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 684
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:project
Requires
- pimple/pimple: ^3.1
- symfony/yaml: ^3.3
Requires (Dev)
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^6.0
- silex/silex: ^2.1
This package is not auto-updated.
Last update: 2020-01-02 20:42:41 UTC
README
This provider add these featres:
- Support for YAML config files
- Allow "import" in files
- Allow variables replacement
Requirements
- Silex 2.0
- PHP7
- Phpunit 6
Install the project
$ docker-compose build
$ docker-compose run --rm composer install
Run the tests
$ docker-compose up -d tests
$ sh scripts/phpunit --converage-html ./coverage
Example
# config.yml debug: false # Database connections database: driver: sqlite
# config_dev.yml imports: - { resource: config.yml } debug: true config_path : %base_path%
$app = new Application(); $app['base_path'] = '/home/user/config'; $app->register(new ConfigProvider(__DIR__ . 'config_dev.yml'), array()); #Import echo $app['config']['database']['driver'] # sqlite #Override echo $app['config']['debug'] # true #Replacement echo $app['config']['config_path'] # /home/user/config