Releases: KaririCode-PHP/dotenv
Releases · KaririCode-PHP/dotenv
KaririCode Dotenv v2.0.0
KaririCode\Dotenv v2.0.0
PHP 8.4+ environment variable engine — zero external dependencies,
AES-256-GCM encryption, fluent validation DSL, OPcache caching,
and environment-aware cascade loading. ARFA 1.3 compliant.
Installation
composer require kariricode/dotenvQuick Start
use KaririCode\Dotenv\Dotenv;
use function KaririCode\Dotenv\env;
// Bootstrap once (e.g. public/index.php)
$dotenv = new Dotenv(__DIR__);
$dotenv->load();
// Auto type-cast: string, int, float, bool, null, array/JSON
$debug = env('APP_DEBUG'); // bool
$port = env('DB_PORT'); // int
$cfg = env('JSON_CONFIG'); // array
// Fluent validation DSL (collect-all semantics)
$dotenv->validate()
->required('APP_KEY', 'DB_HOST')
->isInteger('DB_PORT')->between(1, 65535)
->allowedValues('APP_ENV', ['local', 'staging', 'production'])
->assert();
// bootEnv() cascade: .env → .env.local → .env.{APP_ENV}
$dotenv->bootEnv();Quality Metrics
| Metric | Value |
|---|---|
| Tests | 205 passing |
| Assertions | 396 |
| PHPStan Level | 9 (0 errors) |
| Psalm | 100% (0 errors) |
| Coverage | 100% |
| Dependencies | 0 (runtime) |
See CHANGELOG.md for details.
v1.1.2
What's Changed
- refactor(caster-registry): remove
foreachloop for default caster r… by @walmir-silva in #5
Full Changelog: v1.1.1...v1.1.2
v1.1.1
What's Changed
- style: Apply PHP CS Fixer recommendations by @growthcodeoficial in #4
Full Changelog: v1.1.0...v1.1.1
v1.1.0
What's Changed
- Title: Enhance Test Coverage and Fix Edge Cases in Dotenv Package by @growthcodeoficial in #3
Full Changelog: v1.0.0...v1.1.0
v1.0.0
What's Changed
- Develop by @growthcodeoficial in #1
- Enhance Dotenv Component: Improved Parsing, Type Detection, and Unit Tests by @growthcodeoficial in #2
New Contributors
- @growthcodeoficial made their first contribution in #1
Full Changelog: https://github.com/KaririCode-Framework/kariricode-dotenv/commits/v1.0.0