frdl/environment
Composer 安装命令:
composer require frdl/environment
包简介
Simple PHP environment manager.
关键字:
README 文档
README
This is a environment library for quick environment setup. Forked from ahirarge/environment
Installation
To install through composer, simply put the following in your composer.json file:
{
"require": {
"frdl/environment": "*",
}
}
Usage
index.php
$environment = new Frdlweb\Environment\Environment; $environment->path('/') ->detectEnvironment([ 'local' =>[ 'required' => true, 'hosts' => ['your-machine-name'] ] ]);
index.php
$environment = new Frdlweb\Environment\Environment; $environment->dir('/home/') ->detectEnvironment([ 'local' =>[ 'required' => false, 'hosts' => ['your-machine-name'] ] ]);
You can check your machine name with
hostnamecommand.
.env.local.php
return [ 'secret-password' => 'secret-password-value' ];
.env.local.json
{
"environment": "development"
}
$secret = getenv('secret-password');
Facades
If you wish, you can use environment library with facade connector. Please visit for guideline. ahir/facades
License
MIT
统计信息
- 总下载量: 58
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-19