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

ActiveLibrary

papimod/dotenv
==============

Module Papi

v2.1.0(4mo ago)01585Apache-2.0PHPPHP &gt;=8.3.0

Since Dec 17Pushed 4mo agoCompare

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

READMEChangelogDependencies (4)Versions (4)Used By (5)

DotEnv Papi Module
==================

[](#dotenv-papi-module)

[![](https://camo.githubusercontent.com/4893040bcf8e285d2895bb07a0985e48a3ddc545ff0abdeb11622706315de0f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e352d3737374242343f6c6f676f3d706870)](https://camo.githubusercontent.com/4893040bcf8e285d2895bb07a0985e48a3ddc545ff0abdeb11622706315de0f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e352d3737374242343f6c6f676f3d706870)[![](https://camo.githubusercontent.com/1a63c4971998a5b902b01583c76051a8ee8deec80235c1f6c8b5bd8e78725680/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d322d3838353633303f6c6f676f3d636f6d706f736572)](https://camo.githubusercontent.com/1a63c4971998a5b902b01583c76051a8ee8deec80235c1f6c8b5bd8e78725680/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d322d3838353633303f6c6f676f3d636f6d706f736572)

Description
-----------

[](#description)

Load `.env` when building your [papi](https://github.com/4uruanna/papi). This module uses [gitvlucas/phpdotenv](https://github.com/vlucas/phpdotenv).

Configuration
-------------

[](#configuration)

### `PAPI_DOTENV_DIRECTORY` (CONSTANT)

[](#papi_dotenv_directory-constant)

RequiredNoTypestringDescriptionDirectory where the .env file to load is locatedDefault*Root of your project*### `PAPI_DOTENV_FILE` (CONSTANT)

[](#papi_dotenv_file-constant)

RequiredNoTypestringDescriptionCustom .env file nameDefault`.env`Usage
-----

[](#usage)

Create a `.env` file:

```
ENVIRONMENT=PRODUCTION

HELLO=WORLD
```

Import the module when creating your application:

```
require __DIR__ . "/../vendor/autoload.php";

use Papi\PapiBuilder;
use Papimod\Dotenv\DotEnvModule;
use function DI\create;

define("PAPI_DOTENV_DIRECTORY", __DIR__); # Optionnal
define("PAPI_DOTENV_FILE", ".env"); # Optionnal

$builder = new PapiBuilder();

$builder->setModule(DotEnvModule::class)
    ->build()
    ->run();
```

Use your environment variables anywhere in your code:

```
var_dump($_ENV["HELLO"] === "WORLD"); // true
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22fd4dcec379ce472b56c0f51528fa61ce156e5063756abcce648361770fc839?d=identicon)[4uruanna](/maintainers/4uruanna)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

129.7k5](/packages/hardcastle-xrpl-php)

PHPackages © 2026

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