2017 © Pedro Peláez
 

library config

Gap Config

image

gap/config

Gap Config

  • Thursday, March 1, 2018
  • by zhanjh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 281 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 8 % Grown

The README.md

Gap Config

<?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, (*1)

  • 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, (*2)

  1. setting.local.php (required)
  2. setting.app.php (required)
  3. system/
  4. custom/
  5. local/

The Versions

28/02 2018

v2.0.2

2.0.2.0 https://project.tecposter.cn/diffusion/54/

Gap Config

  Sources   Download

The Requires

  • php >=7.1.0

 

gap

28/02 2018

v2.0.1

2.0.1.0 https://project.tecposter.cn/diffusion/54/

Gap Config

  Sources   Download

The Requires

  • php >=7.1.0

 

gap

28/02 2018

v2.0.0

2.0.0.0 https://project.tecposter.cn/diffusion/54/

Gap Config

  Sources   Download

The Requires

  • php >=7.1.0

 

gap

03/12 2017

1.0.0

1.0.0.0 https://project.tecposter.cn/diffusion/54/

Gap Config

  Sources   Download

The Requires

  • php >=7.1.0

 

gap

03/12 2017

v1.x-dev

1.9999999.9999999.9999999-dev https://project.tecposter.cn/diffusion/54/

Gap Config

  Sources   Download

The Requires

  • php >=7.1.0

 

gap