PHPackages                             68publishers/environment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. 68publishers/environment

ActiveComposer-plugin

68publishers/environment
========================

Composer plugin for environment loading.

v1.1.0(1y ago)07.2k↓45.2%1MITPHPPHP ^7.4 || ^8.0

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/68publishers/environment)[ Packagist](https://packagist.org/packages/68publishers/environment)[ RSS](/packages/68publishers-environment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (16)Used By (1)

Environment
===========

[](#environment)

The component based on the [symfony/dotenv](https://symfony.com/doc/current/components/dotenv.html) for simple loading of the ENV variables and detecting a debug mode.

[![Checks](https://camo.githubusercontent.com/649301cd979defcae8321dcd7fe2b3f8bfa1c127502b9e874aec6d18750fe7a0/68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f36387075626c6973686572732f656e7669726f6e6d656e742f6d6173746572)](https://github.com/68publishers/environment/actions)[![Coverage Status](https://camo.githubusercontent.com/41715e8c801cbfd39074aced5810148ae0e5cad42f1acd5808aed54fe962330f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f36387075626c6973686572732f656e7669726f6e6d656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/68publishers/environment?branch=master)[![Total Downloads](https://camo.githubusercontent.com/c17e05100439d0467a811b2b248dfce42bcb9ed72db5f9e3769bb0b20fb3b8c8/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f36387075626c6973686572732f656e7669726f6e6d656e74)](https://packagist.org/packages/68publishers/environment)[![Latest Version](https://camo.githubusercontent.com/a924fcb2758ddbfb925ec9b5607e5f7d1619b66c5477b014973774f9e23f22f5/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f36387075626c6973686572732f656e7669726f6e6d656e74)](https://packagist.org/packages/68publishers/environment)[![PHP Version](https://camo.githubusercontent.com/9b1c2f12685051a6c01a55569c81c892d2814d6ed4fa365028a9ee37135b1034/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f36387075626c6973686572732f656e7669726f6e6d656e74)](https://packagist.org/packages/68publishers/environment)

Installation
------------

[](#installation)

```
$ composer require 68publishers/environment
```

Usage
-----

[](#usage)

### Default ENV variables

[](#default-env-variables)

The default ENV variables are:

- APP\_ENV
- APP\_DEBUG

Both variables will be always accessible in the global arrays `$_ENV` and `$_SERVER`. The default value for `APP_ENV` is `dev` and `0` for `APP_DEBUG`.

### ENV variables loading

[](#env-variables-loading)

For ENV variables loading call this static method after requiring Composer's autoload and before your application is stared. The first argument is a relative path to the application root directory and the second argument is an array of debug mode detectors.

```
