PHPackages                             maatify/infra-drivers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. maatify/infra-drivers

ActiveLibrary[Database &amp; ORM](/categories/database)

maatify/infra-drivers
=====================

Pure infrastructure driver builders constructed from explicit, typed, readonly configuration objects. No environment access. No adapters. No runtime magic.

v1.0.0(4mo ago)00MITPHPPHP &gt;=8.2CI passing

Since Dec 18Pushed 4mo agoCompare

[ Source](https://github.com/Maatify/infra-drivers)[ Packagist](https://packagist.org/packages/maatify/infra-drivers)[ RSS](/packages/maatify-infra-drivers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

[![Maatify.dev](https://camo.githubusercontent.com/bb8bf9ee079d7f823c9d5e94061d1d4c11dc0898e2b1b5cc9a8a7b04d8bfdd7d/68747470733a2f2f7777772e6d6161746966792e6465762f6173736574732f696d672f696d672f6d6161746966795f6c6f676f5f77686974652e737667)](https://camo.githubusercontent.com/bb8bf9ee079d7f823c9d5e94061d1d4c11dc0898e2b1b5cc9a8a7b04d8bfdd7d/68747470733a2f2f7777772e6d6161746966792e6465762f6173736574732f696d672f696d672f6d6161746966795f6c6f676f5f77686974652e737667)

---

[![Version](https://camo.githubusercontent.com/771e0178759c08893962f620c9f2ca0bf5bc5e6f6780b511eab4a52f9702802e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6161746966792f696e6672612d647269766572733f6c6162656c3d56657273696f6e26636f6c6f723d344331)](https://packagist.org/packages/maatify/infra-drivers)[![PHP](https://camo.githubusercontent.com/de6bb8ca159e12af893ce43a205208bb718037be0100bd105579bdb94ec5da91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6161746966792f696e6672612d647269766572733f6c6162656c3d50485026636f6c6f723d373737424233)](https://packagist.org/packages/maatify/infra-drivers)[![PHP Version](https://camo.githubusercontent.com/0751c5c7ed417028d6909f393af80b98d84b224db16e8307c3988e7eefc8ecdb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d626c7565)](https://camo.githubusercontent.com/0751c5c7ed417028d6909f393af80b98d84b224db16e8307c3988e7eefc8ecdb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d626c7565)

[![Build](https://github.com/Maatify/infra-drivers/actions/workflows/ci.yml/badge.svg?label=Build&color=brightgreen)](https://github.com/Maatify/infra-drivers/actions/workflows/ci.yml)

[![Monthly Downloads](https://camo.githubusercontent.com/cc39b05853fee7fc2b170a121298bac540d19d4153b184a18328eaf78976091b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6161746966792f696e6672612d647269766572733f6c6162656c3d4d6f6e74686c79253230446f776e6c6f61647326636f6c6f723d303041384538)](https://camo.githubusercontent.com/cc39b05853fee7fc2b170a121298bac540d19d4153b184a18328eaf78976091b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6161746966792f696e6672612d647269766572733f6c6162656c3d4d6f6e74686c79253230446f776e6c6f61647326636f6c6f723d303041384538)[![Total Downloads](https://camo.githubusercontent.com/8bf1948a7f223d14bf23bfcb7377ce3f604a6dbb248e86f76d4b267dd7691e6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6161746966792f696e6672612d647269766572733f6c6162656c3d546f74616c253230446f776e6c6f61647326636f6c6f723d324141394530)](https://camo.githubusercontent.com/8bf1948a7f223d14bf23bfcb7377ce3f604a6dbb248e86f76d4b267dd7691e6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6161746966792f696e6672612d647269766572733f6c6162656c3d546f74616c253230446f776e6c6f61647326636f6c6f723d324141394530)

[![Stars](https://camo.githubusercontent.com/dd6137a56ab6524fae9537c8adc1ef7047f8c68f3d19130ca02d2ec9fdf3fb4e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d6161746966792f696e6672612d647269766572733f6c6162656c3d537461727326636f6c6f723d464644343342)](https://camo.githubusercontent.com/dd6137a56ab6524fae9537c8adc1ef7047f8c68f3d19130ca02d2ec9fdf3fb4e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d6161746966792f696e6672612d647269766572733f6c6162656c3d537461727326636f6c6f723d464644343342)[![License](https://camo.githubusercontent.com/05c3a04f1d2ce9f68bd021c44f7c7e7cd2abf5a61cf0321f4b2599e19f8e8d14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d6161746966792f696e6672612d647269766572733f6c6162656c3d4c6963656e736526636f6c6f723d626c756576696f6c6574)](LICENSE)[![Status](https://camo.githubusercontent.com/7ad747e5eefa3aa1040130a413dd5d018f22edbc45638ea213a3376a278e76f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d73756363657373)](https://camo.githubusercontent.com/7ad747e5eefa3aa1040130a413dd5d018f22edbc45638ea213a3376a278e76f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d537461626c652d73756363657373)

[![PHPStan](https://camo.githubusercontent.com/f85016b73718ab38275b913dafed1c1ce7f287c3c2ec319445bc29011149f408/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d344538434145)](https://camo.githubusercontent.com/f85016b73718ab38275b913dafed1c1ce7f287c3c2ec319445bc29011149f408/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d344538434145)[![Coverage](https://camo.githubusercontent.com/70125cdcbc41510cdedf37c75fa8b37ba91f2c963b9c1f9e751b0838468bd0b4/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4d6161746966792f696e6672612d647269766572732f6261646765732f636f7665726167652e6a736f6e)](https://camo.githubusercontent.com/70125cdcbc41510cdedf37c75fa8b37ba91f2c963b9c1f9e751b0838468bd0b4/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4d6161746966792f696e6672612d647269766572732f6261646765732f636f7665726167652e6a736f6e)

[![Changelog](https://camo.githubusercontent.com/32f7664d004132f7e0fb111b5e01bd7270705d1e7247db502287d51910c04cb9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4368616e67656c6f672d566965772d626c7565)](CHANGELOG.md)[![Security](https://camo.githubusercontent.com/a150750c8b2c6ca6209aa80bdf220d2f0950b984df64c1b859a46ee9152570f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656375726974792d506f6c6963792d696d706f7274616e74)](SECURITY.md)

---

maatify/infra-drivers
=====================

[](#maatifyinfra-drivers)

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.

---

What this library is
--------------------

[](#what-this-library-is)

- Builds **real infrastructure drivers**
- Accepts **explicit configuration DTOs**
- Performs **deterministic validation**
- Throws **typed infrastructure exceptions**
- Has **zero environment awareness**

---

What this library is NOT
------------------------

[](#what-this-library-is-not)

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**.

---

Architectural position
----------------------

[](#architectural-position)

```
Application
   ↓
maatify/bootstrap        (env → config wiring)
   ↓
Configuration DTOs
   ↓
maatify/infra-drivers   (driver construction only)
   ↓
Native drivers
   ↓
maatify/data-adapters   (wrappers only)

```

---

Design status
-------------

[](#design-status)

- Architecture: **LOCKED**
- Scope: **LOCKED**
- Versioning: **Semantic Versioning (SemVer)**

Public API changes require a major version bump.

---

Quick Start
-----------

[](#quick-start)

`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.

### Example: MySQL using PDO

[](#example-mysql-using-pdo)

```
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

---

Usage Examples
--------------

[](#usage-examples)

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/`](./examples/README.md)

⚠️ These examples are for **reference only** and are not production bootstraps.

---

One-line identity
-----------------

[](#one-line-identity)

> Build real infrastructure drivers from explicit configuration objects — nothing more, nothing less.

---

🪪 License
---------

[](#-license)

**[MIT License](LICENSE)**© [Maatify.dev](https://www.maatify.dev) — Free to use, modify, and distribute with attribution.

---

👤 Author
--------

[](#-author)

Engineered by **Mohamed Abdulalim** ([@megyptm](https://github.com/megyptm)) Backend Lead &amp; Technical Architect —

---

🤝 Contributors
--------------

[](#-contributors)

Special thanks to the Maatify.dev engineering team and all open-source contributors.

Contributions are welcome. Please read the [Contributing Guide](CONTRIBUTING.md) before opening a PR.

---

 Built with ❤️ by [Maatify.dev](https://www.maatify.dev) — Infrastructure-first PHP libraries

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a885a0810f2762586520ab284c9019aaf0b650b53cdf2a6c13ea10931bb7795?d=identicon)[Maatify](/maintainers/Maatify)

---

Top Contributors

[![megyptm](https://avatars.githubusercontent.com/u/33574895?v=4)](https://github.com/megyptm "megyptm (34 commits)")

---

Tags

buildersconfigurationdriversinfrastructurelow-levelmaatifymongodbmysqlpdophpredisphpconfigurationdatabasepdoredisConnectionmongodbdtoclean architecturedriversinfrastructurereadonlymaatifydriver-builderno-envno-dino-magic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maatify-infra-drivers/health.svg)

```
[![Health](https://phpackages.com/badges/maatify-infra-drivers/health.svg)](https://phpackages.com/packages/maatify-infra-drivers)
```

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

114542.8k6](/packages/apix-cache)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
