gap / config
There is no license information available for the latest version (v2.0.2) of this package.
Gap Config
v2.0.2
2018-02-28 08:32 UTC
Requires
- php: >=7.1.0
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/