Skip to content

Releases: KaririCode-PHP/dotenv

KaririCode Dotenv v2.0.0

02 Mar 23:53
13d784c

Choose a tag to compare

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/dotenv

Quick 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

30 Oct 22:01
86f2952

Choose a tag to compare

What's Changed

  • refactor(caster-registry): remove foreach loop for default caster r… by @walmir-silva in #5

Full Changelog: v1.1.1...v1.1.2

v1.1.1

12 Oct 20:18
cda0293

Choose a tag to compare

What's Changed

  • style: Apply PHP CS Fixer recommendations by @growthcodeoficial in #4

Full Changelog: v1.1.0...v1.1.1

v1.1.0

12 Oct 20:15
37dad36

Choose a tag to compare

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

12 Oct 16:39
01f8ceb

Choose a tag to compare

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