PHPackages                             murilo-perosa/dot-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. murilo-perosa/dot-env

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

murilo-perosa/dot-env
=====================

Load .env files.

v0.0.2(4y ago)15MITPHPPHP &gt;=5.1.0

Since Jan 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/muriloperosa/php-dot-env)[ Packagist](https://packagist.org/packages/murilo-perosa/dot-env)[ RSS](/packages/murilo-perosa-dot-env/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP DotEnv Loader
=================

[](#php-dotenv-loader)

[![Latest Stable Version](https://camo.githubusercontent.com/407758e8c50a6b6d8862c9ee14ff31b8cfb1bad805051f389ede12111fc16c18/687474703a2f2f706f7365722e707567782e6f72672f6d7572696c6f2d7065726f73612f646f742d656e762f76)](https://packagist.org/packages/murilo-perosa/dot-env)[![Total Downloads](https://camo.githubusercontent.com/6b4fe1f71ac52095847d949f328dc11085ba63942edd373c68d27194fd449561/687474703a2f2f706f7365722e707567782e6f72672f6d7572696c6f2d7065726f73612f646f742d656e762f646f776e6c6f616473)](https://packagist.org/packages/murilo-perosa/dot-env)[![License](https://camo.githubusercontent.com/d0feca2bfcd60f3190173cc2173ac8a395c1c89cabc792c1d5b64367cd341a7c/687474703a2f2f706f7365722e707567782e6f72672f6d7572696c6f2d7065726f73612f646f742d656e762f6c6963656e7365)](https://packagist.org/packages/murilo-perosa/dot-env)[![PHP Version Require](https://camo.githubusercontent.com/1e18cbb18058275f0d795c8e29defc9368184b1d958b262240a88d1d03196b6f/687474703a2f2f706f7365722e707567782e6f72672f6d7572696c6f2d7065726f73612f646f742d656e762f726571756972652f706870)](https://packagist.org/packages/murilo-perosa/dot-env)

Simple library to load and get values from `.env` file(s).

Install
-------

[](#install)

```
composer require murilo-perosa/dot-env
```

How to Use
----------

[](#how-to-use)

### Namespace

[](#namespace)

```
use MuriloPerosa\DotEnv\DotEnv;
```

### Load File

[](#load-file)

```
// enter path to .env file
(new DotEnv(__DIR__ . '/../.env'))->load();
```

### Get Values

[](#get-values)

```
// php implementation
$value = getenv('YOUR_KEY');

// package implementation
$value = DotEnv::get('YOUR_KEY');

// package implementation with default value
$value = DotEnv::get('YOUR_KEY', 'DEFAULT_VALUE');
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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

Every ~7 days

Total

2

Last Release

1580d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffa16840bdbb95f677ba5ebf374e627a432129f3cc627e6f19efbbb2c0d65b73?d=identicon)[Murilo Perosa](/maintainers/Murilo%20Perosa)

---

Top Contributors

[![muriloperosa](https://avatars.githubusercontent.com/u/45050585?v=4)](https://github.com/muriloperosa "muriloperosa (14 commits)")

---

Tags

dot env

### Embed Badge

![Health badge](/badges/murilo-perosa-dot-env/health.svg)

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

###  Alternatives

[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)
