gap/config
Composer 安装命令:
composer require gap/config
包简介
Gap Config
关键字:
README 文档
README
<?php use Gap\Config\ConfigBuilder; $settingDir = '/your/setting/dir'; $cacheFile = '/your/setting/cache-file'; $configBuilder = new ConfigBuilder( $settingDir, $cacheFile ); $config = $configBuilder->build(); $debug = $config->bool('debug'); // false $dbDefaultConfg = $config->config('db')->config('default'); $dbDefaultConfig->str('driver'); $dbDefaultConfig->str('database'); $dbDefaultConfig->str('host'); $dbDefaultConfig->str('username'); $dbDefaultConfig->arr('username'); /* [ 'driver' => 'mysql', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'database' => 'db', 'host' => 'host', 'username' => 'username', 'password' => 'passwd' ] */
Structure of setting dir
- setting/
- system/ system config
- custom/ custom config, can overwrite system config
- local/ local config, can overwrite custom and system config, ignored by git
- setting.app.php
- setting.local.php
Config loading sequence
- setting.local.php (required)
- setting.app.php (required)
- system/
- custom/
- local/
统计信息
- 总下载量: 333
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-12-03