mesavolt/env
最新稳定版本:v0.0.1
Composer 安装命令:
composer require mesavolt/env
包简介
Static helper to get environment variables in a Symfony 4+ app, loaded either from .env or .env.local.php
README 文档
README
Usage
Add the package to your project :
composer require mesavolt/env
Use Mesavolt\Env::has() to test if an environment variable exists in your app and
Mesavolt\Env::get() to retrieve it.
Quick note: By default,
Env::get($name)throws an exception when the variable is defined but is empty. UseEnv::getSafe($name)to not throw an exception and get the empty value.
APP_SECRET="i can see dead people" EMPTY_VAR=
Use it in your project :
<?php use Mesavolt\Env; $secret = Env::get('APP_SECRET'); $empty = Env::getSafe('EMPTY_VAR');
Testing
composer dump-autoload # make sure vendor/autoload.php exists
./vendor/bin/phpunit
统计信息
- 总下载量: 1.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-28