PHPackages                             domainflow/core - 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. [Framework](/categories/framework)
4. /
5. domainflow/core

ActiveLibrary[Framework](/categories/framework)

domainflow/core
===============

A lightweight PHP application bootstrapper with service providers, boot phases, middleware, and config management.

v0.1.0(1y ago)0141MITPHPPHP ^8.3||^8.4CI passing

Since Apr 8Pushed 1y agoCompare

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

READMEChangelogDependencies (8)Versions (2)Used By (1)

DomainFlow Core
===============

[](#domainflow-core)

[![Tests](https://github.com/domainflow/core/actions/workflows/tests.yml/badge.svg)](https://github.com/domainflow/core/actions/workflows/tests.yml)[![Packagist Version](https://camo.githubusercontent.com/70ee4762729b37b08cd30681b3536a682cefc49e16b489a728c0606f938fdbc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d61696e666c6f772f636f7265)](https://camo.githubusercontent.com/70ee4762729b37b08cd30681b3536a682cefc49e16b489a728c0606f938fdbc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d61696e666c6f772f636f7265)[![PHP Version](https://camo.githubusercontent.com/4742a1eec8a5458de87e09da210e09fb0f60986f92ad35d9eefc98688daed636/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f6d61696e666c6f772f636f7265)](https://camo.githubusercontent.com/4742a1eec8a5458de87e09da210e09fb0f60986f92ad35d9eefc98688daed636/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f6d61696e666c6f772f636f7265)[![License](https://camo.githubusercontent.com/3316c437e00d783b09798c8059eea1e371dea2c1cdc20e68c5da82de60bf543b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f6d61696e666c6f772f636f7265)](https://camo.githubusercontent.com/3316c437e00d783b09798c8059eea1e371dea2c1cdc20e68c5da82de60bf543b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f6d61696e666c6f772f636f7265)[![PHPStan](https://camo.githubusercontent.com/70237ca9cbbd2749f729e2c3cd1c3446ffa316f600984bafcbe197d8e9a11d9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230392d627269676874677265656e2e737667)](https://camo.githubusercontent.com/70237ca9cbbd2749f729e2c3cd1c3446ffa316f600984bafcbe197d8e9a11d9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230392d627269676874677265656e2e737667)

The **DomainFlow Core** package is a **Lightweight Application Bootstrapper** with features like **Service Providers**, **Application Bootstrapping**, **Middleware**, **Event Management**, and **Configuration Management** to help structure and maintain PHP back-end applications and microservices.

---

✨ Core Functionality
--------------------

[](#-core-functionality)

- **Application Container**
    Inherits all DI capabilities from [DomainFlow Container](https://www.github.com/domainflow/container), including class auto-wiring, singleton bindings, and contextual bindings.
- **Service Providers**
    Register and configure your services, including deferred loading for improved performance (load services only when first requested).
- **Bootstrapping &amp; Lifecycle Management**
    Built-in support for structured boot phases and graceful termination.
- **Event Management**
    A basic but extendable event dispatcher to publish and subscribe to application events.
- **Configuration &amp; Environment Management**
    Manage environment variables, base paths, and config paths out of the box.
- **Caching**
    Optionally cache resolved service instances (and deferred providers) for faster subsequent loads.

---

📦 Installation
--------------

[](#-installation)

Install **DomainFlow Core** with Composer:

```
composer require domainflow/core
```

---

🧪 Example Usage
---------------

[](#-example-usage)

Below is a minimal example demonstrating how to set up an application, register a service provider, and retrieve a service:

```
