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

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

env-interop/impl
================

Reference implementations for Env-Interop.

1.x-dev(3mo ago)11MITPHPPHP ^8.4CI passing

Since Jan 31Pushed 3mo agoCompare

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

READMEChangelogDependencies (5)Versions (1)Used By (0)

Env-Interop Reference Implementation
====================================

[](#env-interop-reference-implementation)

[![PDS Skeleton](https://camo.githubusercontent.com/50d01a5094afcc3a827c3cadaec43d23b2a256cb249f5fdd6e5ffdb53ea7971c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-pds/skeleton)[![PDS Composer Script Names](https://camo.githubusercontent.com/0c17df07fd0a51ad878f1de0d4c17ea8e460f2e96ce796c8cd58e6c96ed9c08d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d636f6d706f7365722d2d7363726970742d2d6e616d65732d626c75653f7374796c653d666c61742d737175617265)](https://github.com/php-pds/composer-script-names)

The reference *EnvLoaderService* implementation uses `parse_ini_string()` for environment file parsing, and loads only into `$_ENV`.

```
use EnvInterop\Impl\EnvLoader;

// loads a base required file and an optional local file,
// then checks that required variables have been loaded.
new EnvLoader()
    ->loadEnv('.env.ini')
    ->loadEnvIfExists('.env.local.ini')
    ->assertEnv([
        'PDO_DSN',
        'PDO_USERNAME',
        'PDO_PASSWORD',
    ]);
```

The reference implementation for *EnvGetter* reads from a copy of `$_ENV`.

```
use EnvInterop\Impl\Env;
use PDO;

$env = new Env();

$pdo = PDO::connect(
    $env->getEnv('PDO_DSN'),
    $env->getEnv('PDO_USERNAME'),
    $env->getEnv('PDO_PASSWORD'),
);
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance80

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

107d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

---

Top Contributors

[![pmjones](https://avatars.githubusercontent.com/u/25754?v=4)](https://github.com/pmjones "pmjones (3 commits)")

---

Tags

environmentenv

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  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)[imliam/laravel-env-set-command

Set a .env file variable from the command line

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

Laravel env helper commands

7855.4k](/packages/msztorc-laravel-env)[cekurte/environment

A library to get the values from environment variables and process to php data types

5884.0k7](/packages/cekurte-environment)[mirazmac/dotenvwriter

A PHP library to write values to .env (DotEnv) files

19129.3k7](/packages/mirazmac-dotenvwriter)

PHPackages © 2026

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