PHPackages                             krzysztofzylka/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. krzysztofzylka/env

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

krzysztofzylka/env
==================

ENV library

2.0.5(10mo ago)01.6k↓34.6%2MITPHPPHP &gt;=8.0

Since Dec 10Pushed 10mo ago1 watchersCompare

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

READMEChangelog (9)Dependencies (1)Versions (10)Used By (2)

Env
===

[](#env)

This class is used for loading and parsing environment variables from a file.

Install
-------

[](#install)

```
composer require krzysztofzylka/env
```

Load env file
-------------

[](#load-env-file)

```
$env = new \Krzysztofzylka\Env\Env();
$env->loadFromFile('/path/to/env/file');
```

Load multiple env file
----------------------

[](#load-multiple-env-file)

```
$env = new \Krzysztofzylka\Env\Env();
$env->loadFromFile(['/path/to/env/file', '/path/to/env/file', ...]);
```

Load from system (getenv())
---------------------------

[](#load-from-system-getenv)

```
$env = new \Krzysztofzylka\Env\Env();
$env->loadFromSystem();
```

Example ENV file content
------------------------

[](#example-env-file-content)

```
DB_HOST=localhost
DB_NAME=testDB
DB_USER=username
DB_PASS=password

```

Exceptions
----------

[](#exceptions)

File not found: If the given file path does not exist a File not found exception will be thrown.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance54

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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 ~71 days

Recently: every ~41 days

Total

9

Last Release

319d ago

Major Versions

1.0.2 → 2.0.02024-09-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/b71301619d71d2798d3a84f23de616ac1f1c185ab72e4f03e925cff169b03a0d?d=identicon)[krzysztofzylka](/maintainers/krzysztofzylka)

---

Top Contributors

[![krzysztofzylka](https://avatars.githubusercontent.com/u/41385342?v=4)](https://github.com/krzysztofzylka "krzysztofzylka (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-settings

Store your application settings

1.5k5.9M72](/packages/spatie-laravel-settings)[theseer/phpdox

A fast Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT) with event based processing

6012.4M145](/packages/theseer-phpdox)[ynacorp/nova-swatches

A beautiful color picking field for Laravel Nova.

22291.8k1](/packages/ynacorp-nova-swatches)[brickrouge/brickrouge

A toolkit to create HTML elements

301.8k6](/packages/brickrouge-brickrouge)

PHPackages © 2026

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