Skip to content

Releases: Maatify/bootstrap

🔧 EnvironmentLoader Cleanup & Behavior Stabilization — v1.0.4

13 Nov 22:15

Choose a tag to compare

🔧 EnvironmentLoader Cleanup & Behavior Stabilization

This release removes the outdated logic responsible for "restoring" the original
$_ENV values after .env loading.
The behavior previously caused unexpected overrides when applications passed their
own environment variables — especially during tests, workers, or containerized flows.

✔ What Changed

  • Removed the environment "rollback" loop.
  • Loader now respects the final evaluated environment without forced preservation.
  • Internal flow is simpler, faster, and more predictable.

✔ Why This Matters

  • Fixes several edge cases where variables appeared to "disappear" after loading.
  • Avoids unintended overrides in multi-stage environment setups.
  • Ensures consistency across Bootstrap + DataAdapters + all Maatify libraries.

🚀 Version

1.0.4

Release 1.0.3 (fix missing VERSION update)

13 Nov 21:10

Choose a tag to compare

Release 1.0.3 (fix missing VERSION update)

v1.0.2 – Stable Environment Loader (No Override Mode)

13 Nov 20:20

Choose a tag to compare

🚀 Improvements in Environment Loading

This release introduces a fully safe and stable EnvironmentLoader
implementation that prevents .env files from overriding variables
already defined by the runtime, CI/CD pipelines, or PHPUnit tests.

🔒 Key Fixes

  • Added pre-load snapshot of all existing $_ENV and putenv variables.
  • Restored all pre-existing variables after Dotenv load.
  • Ensures that test-injected credentials are never replaced by .env files.
  • Guarantees consistent behavior across all Maatify libraries.
  • Improves isolation during integration and unit tests.

🎯 Result

Environment handling is now deterministic, predictable, and immune
to accidental overrides — especially in complex multi-library setups.


This update prepares the foundation for stable cross-library
environment management under the maatify/bootstrap ecosystem.

Maatify Bootstrap v1.0.0 — Initial Stable Release

09 Nov 17:21

Choose a tag to compare

🧩 Maatify Bootstrap v1.0.0

🚀 Initial Stable Release

Date: 2025-11-09
Author: Mohamed Abdulalim (megyptm)
Project: maatify:bootstrap
License: MIT
Organization: Maatify.dev


⚙️ Overview

Maatify Bootstrap is the core initialization and diagnostics layer powering the entire Maatify ecosystem.
It unifies environment loading, timezone configuration, and startup safety across all projects — ensuring consistent, reliable behavior across development, testing, and production.

“Initialize once, stabilize everywhere.”


✨ What’s New in v1.0.0

✅ Core Features

  • Unified Bootstrap Layer
    • Standardized project initialization via Bootstrap::init().
    • Deterministic .env loading with strict priority.
  • Environment Loader
    • Smart .env resolution:
      1. .env.local
      2. .env.testing
      3. .env
      4. .env.example (fallback)
    • Immutable load mode prevents variable overrides.
  • Helpers
    • EnvHelper: cached access to environment variables.
    • PathHelper: normalized filesystem paths for all platforms.
  • Diagnostics
    • Runtime checks: checkEnv(), checkTimezone(), checkErrors(), isSafeMode().
    • Safe Mode automatically activates if .env.local or .env.testing is found in production.
  • CI/CD Integration
    • GitHub Actions workflow (.github/workflows/tests.yml) for PHP 8.3–8.4.
    • Full PHPUnit 10 test suite.
  • Dockerized Testing
    • Ready-to-run development container with parity to CI environments.
  • Documentation
  • Changelog
    • Initial entry for v1.0.0 release.

🧪 Example Usage

use Maatify\Bootstrap\Core\Bootstrap;
use Maatify\Bootstrap\Core\BootstrapDiagnostics;
use Maatify\PsrLogger\LoggerFactory;

Bootstrap::init(); // unified startup

$logger = LoggerFactory::create('bootstrap');
$diag = new BootstrapDiagnostics($logger);
print_r($diag->run());

🐳 Docker Support

To test locally with full environment parity:

docker compose up --build
docker compose exec bootstrap composer run-script test

🧠 Environment Priority Recap

Priority File Context
1️⃣ .env.local Developer/private
2️⃣ .env.testing CI & PHPUnit
3️⃣ .env Production
4️⃣ .env.example Fallback

Once the first file is found, loading stops immediately — ensuring deterministic startup behavior.


🧾 Changelog Snapshot

v1.0.0 — 2025-11-09

  • Added: Core Bootstrap, EnvironmentLoader, Diagnostics
  • Added: PathHelper, EnvHelper
  • Added: Safe Mode activation system
  • Added: CI + Docker integration
  • Added: Documentation suite (phase 1–7)
  • Improved: Error handling and timezone fallback
  • Tested: 100% PHPUnit functional coverage

📦 Installation

composer require maatify/bootstrap

Then initialize:

\Maatify\Bootstrap\Core\Bootstrap::init();

🧰 Related Maatify Libraries

Library Description
maatify/common Common helpers, constants, and string utilities.
maatify/psr-logger PSR-3 compatible logging layer.
maatify/rate-limiter Redis-powered rate limiting.
maatify/data-adapters Secure data access and ORM adapters.
maatify/security-guard Core security enforcement layer.

🏁 Next Steps

  • Publish to Packagist under maatify/bootstrap

  • Tag version:

    git tag -a v1.0.0 -m "Initial stable release — Maatify Bootstrap"
    git push origin v1.0.0
  • Verify Packagist auto-sync

  • Enable CI badge on GitHub main README


🧠 Summary Matrix

Aspect Status Notes
Environment Loading Deterministic, priority-based
Timezone Config Defaults → Africa/Cairo
Safe Mode Activates on non-prod .env in production
Logging Integration PSR-3 compliant
PHPUnit Coverage >95%
CI/CD Pipeline Automated GitHub workflow
Docker Support Local + CI parity

🧾 License

MIT License — see LICENSE

© 2025 Maatify.dev
All Rights Reserved.