veka-server / config
一个配置文件管理类
0.2.2
2017-11-07 19:47 UTC
This package is auto-updated.
Last update: 2024-09-26 20:15:24 UTC
README
为我的框架创建的配置文件管理类
使用
在代码中尽早初始化
// initialise le singleton de configuration \VekaServer\Config\Config::getInstance(__DIR__.'/config/config.php');
获取值
\VekaServer\Config\Config::getInstance()->getSetting('db_pass');
或
\VekaServer\Config\Config::getInstance()->get('db_pass');
配置文件示例
<?php return array( // Environnement "ENV" => 'DEV', // DEV / PROD // BDD "db_user" => 'root', "db_pass" => 'root', "db_host" => 'localhost', "db_name" => 'mabase' );