mesavolt/env 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Stable Version Build Status Coverage Status License

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. Use Env::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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-28