garoevans / config_loader
非常简单的 ini 配置加载器
v0.0.1
2014-07-17 08:56 UTC
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-24 02:00:28 UTC
README
安装
此库需要 PHP 5.3 或更高版本,可以通过 Composer 以 garoevans/config_loader 的方式安装和自动加载。
用法
use Garoevans\ConfigLoader; $config = ConfigLoader('config_directory', 'ini_file_name.ini'); $config->load(); // Gets the ini section called 'db' or returns an empty array $config->get('db', array()); // Gets the value of 'host' from the 'db' section or returns an empty string $config->get('db/host', '');