<?php
/**
 * Link         :   http://www.phpcorner.net
 * User         :   qingbing<780042175@qq.com>
 * Date         :   2018-12-05
 * Version      :   1.0
 */
require("../vendor/autoload.php");
// 定义环境变量
defined("PHP_ENV") or define("PHP_ENV", "dev");
// 定义配置存放目录
defined("CONFIG_PATH") or define("CONFIG_PATH", dirname(realpath(".")) . "/conf");
// 定义配置缓存的存放目录
defined("RUNTIME_PATH") or define("RUNTIME_PATH", dirname(realpath(".")) . "/runtime");

// 默认获取为"application"的无类型配置
$configs = Config::getInstance()->getAll();
var_dump($configs);
$configs = Config::getInstance("application")->getAll();
var_dump($configs);

// 获取具体文件所有配置
$configs = Config::getInstance("database", "master")->getAll();
var_dump($configs);
// 获取具体id的配置信息
$configs = Config::getInstance("database", "slave")->getById('dsn');
var_dump($configs);
