PHPackages                             crysalead/env - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. crysalead/env

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

crysalead/env
=============

Environment variable container

1.0.1(8y ago)020.7k↓26.9%MITPHPPHP &gt;=5.4

Since Dec 20Pushed 8y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (3)Used By (0)

Env - Environment variable container
====================================

[](#env---environment-variable-container)

[![Build Status](https://camo.githubusercontent.com/0d71bc6cf1bdc34ce673fc9b11177bb14c9e6a01f4f62c6670ced8f8b9a51895/68747470733a2f2f7472617669732d63692e6f72672f63727973616c6561642f656e762e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/crysalead/env)[![Code Coverage](https://camo.githubusercontent.com/e062198efac899fb72f05b70da1bb458639264ebf518c9c20baa49232e348c66/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63727973616c6561642f656e762f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/crysalead/env/)

Environment variable container.

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

[](#installation)

```
composer require crysalead/env
```

API
---

[](#api)

### Example

[](#example)

```
use Lead\Env\Env;

$env = new Env($_SERVER + $_ENV);

$env['PHP_SELF'];

$env['UNEXISTING_VARIABLE']; // returns `false` like `getenv()` on undefined

$env['CUSTOM_VARIABLE'] = 'myvalue';

// Multiple set
$env->set([
    'CUSTOM_VARIABLE2' => 'myvalue2',
    'CUSTOM_VARIABLE3' => 'myvalue3'
]);

isset($env['CUSTOM_VARIABLE']);

unset($env['CUSTOM_VARIABLE']);

$env->clear(); // removes all variables.
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~566 days

Total

2

Last Release

3235d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c78f317fdfb9f077b1f16c88193192f7562e999c536b25943b759c3b5099fb?d=identicon)[jails](/maintainers/jails)

---

Top Contributors

[![jails](https://avatars.githubusercontent.com/u/1306941?v=4)](https://github.com/jails "jails (7 commits)")

---

Tags

environment

### Embed Badge

![Health badge](/badges/crysalead-env/health.svg)

```
[![Health](https://phpackages.com/badges/crysalead-env/health.svg)](https://phpackages.com/packages/crysalead-env)
```

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/dotenv

Registers environment variables from a .env file

3.8k226.7M2.3k](/packages/symfony-dotenv)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1554.7M7](/packages/foroco-php-browser-detection)[wolfcast/browser-detection

The Wolfcast BrowserDetection PHP class facilitates the identification of the user's environment such as Web browser, version, platform family, platform version or if it's a mobile device or not.

1391.0M7](/packages/wolfcast-browser-detection)[imliam/laravel-env-set-command

Set a .env file variable from the command line

118352.4k10](/packages/imliam-laravel-env-set-command)[silverstripe/environmentcheck

Provides an API for building environment tests

35503.8k13](/packages/silverstripe-environmentcheck)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
