PHPackages                             morainstein/dotenv - 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. morainstein/dotenv

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

morainstein/dotenv
==================

A simple lib for loading environment variables in PHP

1.0.0(9mo ago)03MITPHP

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/morainstein/PHP-DotEnv)[ Packagist](https://packagist.org/packages/morainstein/dotenv)[ Docs](https://github.com/morainstein/PHP-DotEnv)[ RSS](/packages/morainstein-dotenv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

DotEnv Component
================

[](#dotenv-component)

A simple way to use your environment variables in PHP

Getting Started
---------------

[](#getting-started)

```
composer require morainstein/dotenv

```

```
use Morainstein\DotEnv;

//You may also ommit the $envFilePath param, so it finds the .env in the working directory of application
$dotenv = new DotEnv($envFilePath);

//Just simple as it looks!
$envValue = $dotenv->get('envKey')
```

Recomendation
-------------

[](#recomendation)

Load the DotEnv class in your bootstrap file, then use it everywhere in your application

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance56

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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

293d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/106cba479309569a319a273197aeb3aa5927c7011cb4dddf1b359eb49837867d?d=identicon)[morainstein](/maintainers/morainstein)

---

Top Contributors

[![morainstein](https://avatars.githubusercontent.com/u/158575506?v=4)](https://github.com/morainstein "morainstein (9 commits)")

---

Tags

envdotenvenvironment variables

### Embed Badge

![Health badge](/badges/morainstein-dotenv/health.svg)

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

###  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)[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)[m1/env

Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.

6412.0M21](/packages/m1-env)[sroze/companienv

Companion for .env files

245418.8k1](/packages/sroze-companienv)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4144.1k1](/packages/bnomei-kirby3-dotenv)

PHPackages © 2026

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