PHPackages                             nigr/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. nigr/dotenv

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

nigr/dotenv
===========

for parsing .env files

05PHP

Since Dec 28Pushed 4mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Get started:
------------

[](#get-started)

### Install library:

[](#install-library)

```
    composer require nigr/dotenv:@dev
```

### Call function than parsed ENV-file:

[](#call-function-than-parsed-env-file)

```
  use Nigr/Dotenv;

  $dotenv = new Dotenv();
  $dotenv->parse();
```

### If file locates not in root folder, pass as argument path to file in function envPasre():

[](#if-file-locates-not-in-root-folder-pass-as-argument-path-to-file-in-function-envpasre)

```
  $dotenv = new Dotenv();
  $dotenv->parse("/env/.env.dev");
```

### For call variable, can use $\_ENV, $\_SERVER and getenv():

[](#for-call-variable-can-use-_env-_server-and-getenv)

```
  $_ENV['DB_USER'];
  $_SERVER['DB_HOST'];
  getenv('DB_PORT');
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance51

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/38d7591c1d1cc143dc1198c586379e9d571162358c4a3487acab436f4d4692e1?d=identicon)[NikitinVladimirV](/maintainers/NikitinVladimirV)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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