Skip to content

Adapter

Eight infrastructure packages - PSR-compatible, no framework coupling, individually usable.

The adapter layer implements the outer ports of the Hexagonal Architecture and provides concrete infrastructure for PHP applications: database connections, caching, structured logging, event dispatching and messaging. Each package implements the interfaces defined in jardissupport/contracts and can be used independently of the rest of the Jardis stack - including in existing projects without a DDD runtime.

Overview

Adapters form the outer layer of the Hexagonal Architecture. They implement interfaces from Contract and provide concrete infrastructure: database connections, caching, logging, events, HTTP, email, messaging and filesystems. Each package is independently usable: without Jardis Core, without a framework.

GitHub: jardisAdapter

Packages

Cache

Multi-layer caching with automatic write-through: from in-memory to database. PSR-16 compatible, five adapters (Memory, APCu, Redis, Database, Null), namespace isolation.

bash
composer require jardisadapter/cache

Database Connection

PDO connection management with connection pool, read/write splitting and health checks. Supports MySQL, PostgreSQL and SQLite.

bash
composer require jardisadapter/dbconnection

Event Dispatcher

Four classes, zero magic: synchronous event dispatching for Domain-Driven Design. PSR-14 compatible, priority ordering, type-hierarchy matching, stoppable events.

bash
composer require jardisadapter/eventdispatcher

Filesystem

Local filesystem and S3 with one API: without AWS SDK, without Flysystem. Stream support, visibility management, unified abstraction.

bash
composer require jardisadapter/filesystem

HTTP Client

PSR-18 HTTP client with handler pipeline, retry and its own PSR-7 implementation: without Guzzle, without Symfony. Convenience methods, Bearer/Basic auth, exponential backoff.

bash
composer require jardisadapter/http

Logger

Structured logging with 20+ handlers, fluent configuration and built-in error resilience. PSR-3 compatible, file, console, Redis, Slack, Loki and more.

bash
composer require jardisadapter/logger

Mailer

Direct SMTP delivery with STARTTLS, attachments and connection keepalive: without Swiftmailer, without Symfony. HTML/text, retry, configurable timeouts.

bash
composer require jardisadapter/mailer

Messaging

Multi-transport messaging with Redis, Kafka, RabbitMQ, database and in-memory: one API for all. Publisher/consumer pattern, unified interface.

bash
composer require jardisadapter/messaging

Common Traits

  • PSR-compatible — PSR-3, PSR-14, PSR-16, PSR-18 where applicable
  • Closure-Orchestrator Pattern — consistent architecture in every package
  • No framework coupling — usable with or without Jardis Core
  • Interfaces from Contract — swappable with custom implementations