https://github.com/domainflow/core
Lightweight PHP application core with service providers, boot phases, middleware, and event dispatching.
https://github.com/domainflow/core
bootstrap container dependencyinjection di domainflow kernel modular php provider
Last synced: 4 months ago
JSON representation
Lightweight PHP application core with service providers, boot phases, middleware, and event dispatching.
- Host: GitHub
- URL: https://github.com/domainflow/core
- Owner: domainflow
- License: mit
- Created: 2025-04-08T11:02:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T11:08:18.000Z (about 1 year ago)
- Last Synced: 2025-07-21T04:27:24.434Z (11 months ago)
- Topics: bootstrap, container, dependencyinjection, di, domainflow, kernel, modular, php, provider
- Language: PHP
- Homepage: https://www.domainflow.dev/docs/core
- Size: 59.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DomainFlow Core
[](https://github.com/domainflow/core/actions/workflows/tests.yml)




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
- **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 & 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 & 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
Install **DomainFlow Core** with Composer:
```sh
composer require domainflow/core
```
---
## ๐งช Example Usage
Below is a minimal example demonstrating how to set up an application, register a service provider, and retrieve a service:
```php
bind(MyService::class, fn() => new MyService(), true);
}
}
// 2. Create a new application.
$app = new Application();
// 3. Register your provider.
$app->registerProvider(new MyServiceProvider());
// 4. Boot the application (register event listeners, run boot callbacks, etc.).
$app->boot();
// 5. Get your service.
$service = $app->get(MyService::class);
$service->doSomething();
```
---
More details and usage examples can be found in our [DomainFlow Core documentation](https://www.domainflow.dev/docs/core).
---
## ๐ก License
**DomainFlow Core** is open-sourced software licensed under the [MIT license](https://opensource.org/license/MIT).