ahir / environment
1.3.1
2015-04-28 06:45 UTC
This package is not auto-updated.
Last update: 2023-08-29 17:40:04 UTC
README
这是一个快速设置环境的库。
安装
通过composer安装,只需将以下内容放入您的composer.json
文件中
{ "require": { "ahir/environment": "1.*", } }
使用
index.php
$environment = new Ahir\Environment\Environment; $environment->path('/') ->detectEnvironment([ 'local' => ['your-machine-name'] ]);
index.php
$environment = new Ahir\Environment\Environment; $environment->file('/home/') ->detectEnvironment([ 'local' => ['your-machine-name'] ]);
您可以使用
hostname
命令检查您的机器名称。
.env.local.php
return [ 'secret-password' => 'secret-password-value' ];
.env.local.json
{ "environment": "development" }
$secret = getenv('secret-password');
外观
如果您愿意,可以使用外观连接器使用环境库。请访问指南。 ahir/facades
许可证
MIT