junker / yaml-configuration-service-provider
YAML Configuration Service Provider for Silex
0.2.0
2020-06-18 15:02 UTC
Requires
- silex/silex: ~2.0
- symfony/config: ~3.0|~4.0
- symfony/yaml: ~3.0|~4.0
This package is auto-updated.
Last update: 2024-10-19 00:10:51 UTC
README
YAML Configuration Service Provider for Silex
Requirements
silex 2.x
Installation
The best way to install YamlConfigurationServiceProvider is to use a Composer:
php composer.phar require junker/yaml-configuration-service-provider
Supports
- Recursive config imports (Configuration Organization)
- Config Cache (Performance boost)
Examples
use Junker\Silex\Provider\YamlConfigurationServiceProvider; $app->register(new YamlConfigurationServiceProvider('config.yml')); # or $app->register(new YamlConfigurationServiceProvider('config.yml', ['cache_dir' => '/tmp/config_cache'])); $db_host = $app['config']['db']['host'];
Config example:
imports: - { resource: 'site/config.yml' } - { resource: 'security.yml' } db: host: localhost login: root pass: 123123 database: site12 facebook: scope: 'public_profile,email,user_birthday,user_location,user_photos' secret_key: FDSLKFDNSLsdre23lkndas