papi/dotenv

Dotenv Module

Maintainers

Package info

github.com/4uruanna/papi-dotenv

pkg:composer/papi/dotenv

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-02-03 14:55 UTC

This package is auto-updated.

Last update: 2026-03-04 17:26:29 UTC


README

PACKAGIST | GITHUB

Description

Load environment (.env) when building your PAPI. This module uses gitvlucas/phpdotenv under the hood.

Configuration

Constants

Name Required Type Default Description
DOTENV_PATH No String ".env" Directory where the .env file to load is located

Usage

DotenvEvent is called during BeforeBuild event. We recommend putting it first to avoid any mistakes.

use PAPI\Core\SlimBuilder;
use PAPI\Mod\Dotenv\DotenvEvent;

define("DOTENV_PATH", __DIR__ . DIRECTORY_SEPARATOR . ".env");

$builder = new SlimBuilder();

$builder
    ->addEvent(DotenvEvent::class)
    ->build()
    ->run();