zhan3333/config

There is no license information available for the latest version (dev-master) of this package.

dev-master 2017-06-01 03:00 UTC

This package is auto-updated.

Last update: 2023-01-14 16:40:36 UTC


README

  • 加载php配置文件
  • 加载php配置文件夹
  • 批量加载php配置文件

示例

require 'vendor/autoload.php';

use LoadConfig\Config;

// 加载文件夹
$path = '/rootpath/config';
$config = new Config($path);

// 加载单个文件
$path = '/path/to/config/databases.php';
$config = new Config($path);

// 加载多个文件
$paths = [
    '/rootpath/config',
    '/path/to/config/databases.php',
];
$config = new Config($paths);

// 取值
$host = $config->get('databases.mysql.host');
$host = $config['databses.mysql.host'];