Introduction
Overview
This guide explains what DomainFlow Core is, how to install it via Composer, and provides a short overview of its major features. This package extends a base Container (documented separately), adding advanced lifecycle management, event handling, attribute-based registration, and more.
DomainFlow Core´s main class Application extends the base Container class, which provides a robust dependency injection container. So all features of the base Container are available in DomainFlow Core. For more information on the base Container, see the separate documentation.
Installing DomainFlow Core
Install the DomainFlow Core package using Composer by running:
composer require domainflow/core
Feature Overview
Below is a short description of the main features provided by DomainFlow Core. Each feature is explained in more detail throughout the documentation.
-
Application Lifecycle DomainFlow provides a structured boot process with callbacks for “booting” and “booted,” plus a termination phase for graceful shutdown.
-
Service Providers You can organize your application logic into self-contained providers, which can be registered eagerly or deferred until needed.
-
Event System A robust event dispatcher is built in, allowing you to declare event listeners (including wildcard listeners) and dispatch events throughout your app.
-
Attribute-Based Registration Classes, methods, and constructor parameters can be annotated with special attributes (e.g.,
#[Service]
or#[Inject]
) to automate common tasks like service registration and dependency injection. -
Middleware Pipeline Chain multiple middleware callables to handle cross-cutting concerns (e.g., authentication, logging) in an organized flow.
-
Path & Environment Management Easily set and retrieve application base paths, configuration paths, and manage your current runtime environment (e.g., production, development).
Each feature is designed to help you structure your application cleanly and take advantage of modern PHP capabilities. Additional documents and reference sections will dive deeper into these concepts and provide examples of practical usage in real projects.