rpodwika/yaml-config-service-provider
最新稳定版本:1.0.1
Composer 安装命令:
composer require rpodwika/yaml-config-service-provider
包简介
Based on deralex/YamlConfigServiceProvider YAML service provider for silex ~2.0 and symfony/yaml 3.~
README 文档
README
Usage
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app->register(new Rpodwika\Silex\YamlConfigServiceProvider(PATH_TO_CONFIG_FILE));
echo $app['config']['database']['driver'];
...
where PATH_TO_CONFIG_FILE is location of YML file with configuration for example __DIR__ . "/../app/config/parameters.yml"
considering following directory structure:
- app
- config
- parameters.yml
- config
- web
- index.php
parameters.yml
database:
driver : 'pdo_mysql'
dbhost : 'localhost'
dbname : 'mydbname'
user : 'root'
password : ''
Installation
Add to composer.json
"require": {
"rpodwika/yaml-config-service-provider": "dev-master"
}
or run command composer require rpodwika/yaml-config-service-provider
This bundle is inspired on deralex/YamlConfigServiceProvider
Licence
统计信息
- 总下载量: 30.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-09-15