Skip to content

Plugin System

The plugin system implements the Port & Adapter pattern, providing extensible framework capabilities through interfaces (Ports) and implementations (Adapters).

In This Section

Plugin Structure

Each plugin in src/Plugin/ contains:

  • Port/ - Interfaces defining the contract
  • Adapter/ - One or more implementations
  • Internal/ (optional) - Plugin-internal utilities

Available Plugins

Plugin Port Adapters
CommandBus CommandBusInterface SyncCommandBus, TransactionalCommandBus
QueryBus QueryBusInterface SyncQueryBus
EventBus EventBusInterface SyncEventBus
Dispatcher DispatcherInterface (PSR-14), ListenerRegistryInterface (PSR-14) LeagueDispatcher, LeagueListenerRegistry
Logger LoggerInterface FileLogger, NullLogger
Session SessionInterface OdanSession
Authorization AuthorizationInterface RbacAuthorizationService
Cache CacheInterface (PSR-16) InMemoryCache, RedisCache, FileCache, NullCache
Transaction TransactionInterface InMemoryTransaction, SqliteTransaction, MysqlTransaction, PostgresqlTransaction
SqlDriver SqlDriverInterface InMemoryDriver, SqliteDriver, MysqlDriver, PostgresqlDriver
IdGenerator IdGeneratorInterface UuidV4Generator, UuidV7Generator, UlidGenerator, TimestampIdGenerator
Clock ClockInterface SystemClock, MonotonicClock, FrozenClock, OffsetClock
PasswordHasher PasswordHasherInterface BcryptPasswordHasher, PlaintextPasswordHasher

Usage Pattern

Depend on Ports (interfaces), never on Adapters directly:

public function __construct(
    private readonly LoggerInterface $logger,
) {}

Configure adapter selection in config/{app}/container.php:

LoggerInterface::class => DI\get(FileLogger::class),