davek1312/config
Composer 安装命令:
composer require davek1312/config
包简介
Bootstraps vlucas/phpdotenv and illuminate/config packages
关键字:
README 文档
README
Bootstraps vlucas/phpdotenv and illuminate/config packages.
Installation
The package is available on Packagist, you can install it using Composer.
composer require davek1312/config
Configuration
Environment Variables
Copy vendor/davek1312/config/davek1312 folder to your application's root directory and rename config/.env.example to .env. View the .env data format on GitHub.
You should not commit your .env file to your version control system.
Register Configuration Files
To register your configuration files view the davek1312\app documentation.
Add your configuration files to the registered configuration folder.
//configuration folder/test.php
<?php
return [
'key' => 'value',
];
Usage
Environment Variables
You can use any of the methods from the vlucas/phpdotenv package.
You can also use the davek1312_env function.
// If $key is not found in your .env file $default will be returned
davek1312_env($key, $default = null);
Configuration Files
Retrieving configuration values:
use Davek1312\Config\Config;
$config = new Config();
$value = $config->get('tests.key'); //Will return 'value';
$value = $config->get('tests.non_existent'); //Will return NULL;
All other methods for the Config class can be found here.
统计信息
- 总下载量: 74
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-10