Pure infrastructure driver builders for PHP.
maatify/infra-drivers is a low-level infrastructure library responsible for
constructing real native drivers (PDO, Redis, MongoDB, etc.)
from explicit, typed, readonly configuration objects.
This package exists to strictly separate driver construction from application bootstrap logic, adapters, and domain concerns.
- Builds real infrastructure drivers
- Accepts explicit configuration DTOs
- Performs deterministic validation
- Throws typed infrastructure exceptions
- Has zero environment awareness
This package does not:
- Read environment variables
- Use dotenv or env loaders
- Provide DI containers or service locators
- Wrap adapters or expose unified APIs
- Perform runtime detection or switching
- Implement retries, pooling, or lifecycle management
- Make logging or monitoring decisions
Any such behavior is considered a design violation.
Application
↓
maatify/bootstrap (env → config wiring)
↓
Configuration DTOs
↓
maatify/infra-drivers (driver construction only)
↓
Native drivers
↓
maatify/data-adapters (wrappers only)
- Architecture: LOCKED
- Scope: LOCKED
- Versioning: Semantic Versioning (SemVer)
Public API changes require a major version bump.
maatify/infra-drivers is a low-level infrastructure wiring library.
It builds real native drivers from explicit configuration DTOs without reading environment variables or relying on DI containers.
use Maatify\InfraDrivers\Config\MySQL\MySQLConfigDTO;
use Maatify\InfraDrivers\Builder\MySQL\MySQLDriverBuilder;
$config = new MySQLConfigDTO(
dsn: 'mysql:host=localhost;dbname=test_db;charset=utf8mb4',
username: 'user',
password: 'password'
);
$builder = new MySQLDriverBuilder();
/** @var PDO $pdo */
$pdo = $builder->build($config);This example demonstrates pure wiring only:
- No environment loading
- No service container
- No abstraction layer
This repository includes standalone executable examples demonstrating correct usage for all supported drivers.
Available examples:
- MySQL (PDO)
- MySQL (Doctrine DBAL)
- Redis (ext-redis)
- Redis (Predis)
- MongoDB
📁 See the full list in examples/
Build real infrastructure drivers from explicit configuration objects — nothing more, nothing less.
MIT License © Maatify.dev — Free to use, modify, and distribute with attribution.
Engineered by Mohamed Abdulalim (@megyptm) Backend Lead & Technical Architect — https://www.maatify.dev
Special thanks to the Maatify.dev engineering team and all open-source contributors.
Contributions are welcome. Please read the Contributing Guide before opening a PR.
Built with ❤️ by Maatify.dev — Infrastructure-first PHP libraries