2017 © Pedro Peláez
 

library habitat

A dependable php environment

image

brianium/habitat

A dependable php environment

  • Thursday, April 13, 2017
  • by brianium
  • Repository
  • 2 Watchers
  • 9 Stars
  • 2,259,583 Installations
  • PHP
  • 7 Dependents
  • 2 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

Habitat Build Status

Because we dont always know if $_ENV is available, (*1)

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, (*2)

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., (*3)

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, (*4)

The Versions

13/04 2017

dev-master

9999999-dev

A dependable php environment

  Sources   Download

MIT

The Development Requires

environment env

08/06 2013

v1.0.0

1.0.0.0

A dependable php environment

  Sources   Download

MIT

The Development Requires