phpbook/environment 问题修复 & 功能扩展

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

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

phpbook/environment

Composer 安装命令:

composer require phpbook/environment

包简介

PHP Environment Library

README 文档

README

About Environment

  • A PHP library to control server environments variables.

Composer Install

composer require phpbook/environment

Declare Configurations

<?php

/********************************************
 * 
 *  Declare Configurations
 * 
 * ******************************************/

/* Prefix environments variables. Default with no Prefix ('') */
\PHPBook\Environment\Variable::prefix('MY-APP-');

/* Get the prefix of environments variables. In this case returns 'MY-APP-' */
$prefix = \PHPBook\Environment\Variable::prefix(); 

/* Clear the prefix of environments variables. */
\PHPBook\Environment\Variable::prefix('');

/* Assign a environment variable with description */
\PHPBook\Environment\Variable::assign('APP-NAME', 'Application Name');

/* Assign a environment variable with description */
\PHPBook\Environment\Variable::assign('APP-VERSION', 'Application Version');

/* Get environment variable value */
$name = \PHPBook\Environment\Variable::get('APP-NAME');
if ($name) { // returns if assigned or null
	$name->getName(); $name->getDescription(); $name->getValue();
};

/* Get environment variable value */
$version = \PHPBook\Environment\Variable::get('APP-VERSION');
if ($version) { // returns if assigned or null
	$version->getName(); $version->getDescription(); $version->getValue();
};

/* Get all environment variable with values */
$variables = \PHPBook\Environment\Variable::list();
foreach($variables as $variable) {
	$variable->getName();
	$variable->getDescription();
	$variable->getValue();
};

?>
  • Remember when you change the environment variable, you must restart your webserver or shell.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固