Download the PHP package jardissupport/dotenv without Composer
On this page you can find all versions of the php package jardissupport/dotenv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jardissupport/dotenv
More information about jardissupport/dotenv
Files in jardissupport/dotenv
Package dotenv
Short Description Environment file loader with cascading overrides, variable interpolation, type casting, and include directives
License MIT
Homepage https://jardis.io
Informations about the package dotenv
Jardis DotEnv
Part of Jardis — the Domain-Driven Design platform for PHP. You model your domain; Jardis generates the production-ready hexagonal code (DTOs, Command/Query handlers, repositories, persistence). This package is part of the open-source foundation that generated code runs on.
A .env loader for PHP with cascading overrides, variable interpolation, type casting, and include directives. Goes beyond simple .env parsing — supports public and private loading modes, nested variable references, and an extensible cast chain.
Features
- Public/Private Loading —
loadPublic()writes to$_ENV/$_SERVER;loadPrivate()returns an isolated array without touching global state - Cascading Overrides — two-stage loading: base
.envfirst, thenAPP_ENV-specific files (e.g..env.production) override selectively - Variable Interpolation —
${VAR}references are resolved against already-loaded values in the same file - Type Casting Chain — automatically converts strings to
bool, numeric, JSON, andarrayvia a chainable handler pipeline - Home Path Expansion —
~/is expanded to the OS home directory in both loading modes - Include Directives —
load(.env.database)andload?(.env.optional)split configuration across multiple files - Circular Include Detection — prevents infinite include loops with a typed
CircularEnvIncludeException - Docker
_FILESecret Resolution —DB_PASSWORD_FILE=/run/secrets/db_passwordreads the file and exposes the content asDB_PASSWORD. Works with Docker Swarm, Kubernetes mounted secrets, and any file-based secret store. Combines withjardissupport/secret— a_FILEthat containssecret(aes:...)is decrypted automatically through the cast chain - Extensible via
addHandler()— prepend or append custom cast handlers; remove built-in ones viaremoveHandler()
Installation
Quick Start
Advanced Usage
Docker Secret Files (_FILE Pattern)
Read secrets from mounted files — the industry-standard pattern for Docker Swarm and Kubernetes:
The _FILE suffix is stripped, the file content is read and passed through the full cast chain — variable substitution, type casting, and even secret decryption all work:
Documentation
Full documentation, guides, and API reference:
docs.jardis.io/en/support/dotenv
License
This package is licensed under the MIT License.
Jardis · Documentation · Headgent
AI-Assisted Development
This package ships with a skill for Claude Code, Cursor, Continue, and Aider. Install it in your consuming project:
More details: https://docs.jardis.io/en/skills