承接 brianium/habitat 相关项目开发

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

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

brianium/habitat

最新稳定版本:v1.0.0

Composer 安装命令:

composer require brianium/habitat

包简介

A dependable php environment

README 文档

README

Because we dont always know if $_ENV is available

Habitat is a light weight wrapper over PHP's environment variable functionality. Habitat allows the retrieval of all environment variables when the ini setting variables_order does not contain the E flag

Examples

Habitat delegates most functionality to the native php functions getenv and putenv. If $_ENV is not available due to the variables_order ini setting, then Habitat's getAll method will still allow access to all variables that are in $_ENV.

use Habitat\Habit;

//equivalent of getenv('FOO')
$foo = Habitat::getenv('FOO');

//equivalent of putenv('FOO=BAR')
$wasSet = Habitat::putenv('FOO=BAR');

/**
 * Returns $_ENV if set, otherwise set $_ENV via phpinfo() and
 * return it
 */
$all = Habitat::getAll();

Parsers

Habitat can support the cli and html varieties of phpinfo. It will detect the current sapi and use the appropriate method to populate $_ENV

统计信息

  • 总下载量: 11.9M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 46
  • 点击次数: 1
  • 依赖项目数: 7
  • 推荐数: 2

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-08