承接 remotelyliving/php-env 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

remotelyliving/php-env

Composer 安装命令:

composer require remotelyliving/php-env

包简介

A library to marshall environment variables from environments

README 文档

README

Build Status Total Downloads Coverage Status License Scrutinizer Code Quality

php-env

🌎 An Environment Abstraction for PHP 🌎

Use Cases

If you want a boundary between you and your runtime environment, this library can help. If you like to use .env files this library can help.

Installation

composer require remotelyliving/php-env

Usage

Create The Application Environment

<?php
// needs to be set before hand through docker or could grab the app environment from cli args
// EnvironmentType is an enum that you can extend to add more values to
$envType = new EnvironmentType(getenv('ENVIRONMENT'));
$envFile = "/my/app/envs/.{$envType}.env";

// we can now create the app environment
$env = Environment::createWithEnvFile($envType, $envFile);

// tells you which environment you're in
$env->is(EnvironmentType::DEVELOPMENT()); // true
$env->is(EnvironmentType::PRODUCTION()); // false

// tells you if a var exists
$env->has('FOO'); // true

// returns a value caster of a value that can then be called to get stricter types 
$env->get('FOO')->asArray();
$env->get('BAR')->asBoolean();
$env->get('BAR')->asInteger();

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固