Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [[v0.3.0](https://github.com/The-FireHub-Project/Container/compare/v0.2.0...v0.3.0)] – 2026-10-22

### Added
* Disposable service lifecycle management by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3
* Automatic disposal of singleton and scoped services by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3
* Container and scope shutdown support by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3
* Disposable resource tracking with identity deduplication and reverse disposal order by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3
* Active scope tracking to prevent premature container shutdown by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3
* Shared container lifecycle state management by @dieselxxx in https://github.com/The-FireHub-Project/Container/pull/3

### Changed
* Centralized container freezing and closure state management in `ContainerState`.
* Enforced container lifecycle restrictions across dependency resolution operations.
* Improved scope cleanup and resource release during shutdown.

### Fixed
* Prevented dependency resolution after container closure, including cached singleton instances.
* Ensured container shutdown remains idempotent.
* Ensured disposable resources are released even when individual disposal operations fail.
* Prevented container shutdown while active scopes remain registered.


## [[v0.2.0](https://github.com/The-FireHub-Project/Container/compare/v0.1.0...v0.2.0)] – 2026-10-21

### Added
Expand Down
88 changes: 53 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/></a>
<a href="#">
<img
src="https://img.shields.io/badge/Version-0.2.0-d50000?style=flat&labelColor=30363d&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9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jMxM2MxNS4yNTQtMTAuNzQ0LDMyLjQyLTE4LjQ3Nyw1MC41NzUtMjIuNzgzYzAuMjEyLTQuOTYyLDAuMDA1LTkuOTMzLTAuNjItMTQuODZjLTAuMjUzLTEuODc1LTAuNjI0LTMuNzMxLTEuMTEtNS41NkM0MS4yOTksNDUuNzM4LTE1Ljc2MywxMzQuNjIzLDMuODY1LDIyNC42NGM3LjI4LDMzLjM5LDI0LjY0LDYzLjczOCw0OS43MzEsODYuOTRDNDkuNTU5LDI5OS4zMTQsNDcuMzUyLDI4Ni41Miw0Ny4wNDYsMjczLjYwOXoiLz4KICAgIDwvZz4KPC9zdmc+"
src="https://img.shields.io/badge/Version-0.3.0-d50000?style=flat&labelColor=30363d&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMzMuNjUxIDM4Ny4wOSI+CiAgICA8dGl0bGU+RmlyZWh1YiBJY29uPC90aXRsZT4KICAgIDxzdHlsZT4KICAgICAgICAuY29sb3Ige2ZpbGw6ICNkNTAwMDA7fQogICAgPC9zdHlsZT4KICAgIDxnPgogICAgICAgIDxwYXRoIGNsYXNzPSJjb2xvciIgZD0iTTI2Ny4xMDYsMjYyLjU2MWMxMC41LTE3LjYzMSwxOS42My0zNi45MzEsMjAuMTItNTcuNDUxYzAuNDktMjAuNTItOS42LTQyLjQxOS0yOC40Ni01MC41MmM1LjcxLDkuNjcsMTAuMjUsMjAuNjIsOS4yOCwzMS44MWMtMC45NywxMS4xOS04Ljg2LDIyLjM3LTIwLDI0Yy0xMC40OSwxLjUyOS0yMC43Ny01Ljg1MS0yNS41MS0xNS4zNGMtNC43NC05LjQ5MS00LjYyLTIwLjU2MS00LTMxLjE1QzIyNC4zOTYsNTYuMTcsMTQyLjA0Niw1Ljk0LDEyNy4yODYsMGMwLDAsMTEuNDksMTIuMzksMTMuODgsMzAuNTNjMS45LDE0LjQ0LDAuMTcsMjk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ODMsNC40LDUuMTMsNi42NGM3OS42NzQsMTQuMjQ0LDEzMi43MTYsOTAuMzgsMTE4LjQ3MiwxNzAuMDU0Yy02Ljk0NywzOC44NTctMjkuMjc2LDczLjI3LTYxLjkzMiw5NS40NDZjLTEuNDMsMy0yLjc3LDYtNCw5Yy0yLjUyOCw2LjM3Ny00LjMzLDEzLjAxOS01LjM3LDE5LjhjODIuODQ5LTQwLjMyOSwxMTcuMzE4LTE0MC4xODUsNzYuOTg5LTIyMy4wMzNDMjg5Ljg0OSw2MC43OSwyMzQuNjM1LDI0Ljc3NywxNzMuMTM2LDIyLjQzeiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjb2xvciIgZD0iTTQ3LjA0NiwyNzMuNjA5di0wLjA4QzAuNDM1LDIwNy4zNTQsMTYuMjk2LDExNS45MjMsODIuNDcxLDY5LjMxM2MxNS4yNTQtMTAuNzQ0LDMyLjQyLTE4LjQ3Nyw1MC41NzUtMjIuNzgzYzAuMjEyLTQuOTYyLDAuMDA1LTkuOTMzLTAuNjItMTQuODZjLTAuMjUzLTEuODc1LTAuNjI0LTMuNzMxLTEuMTEtNS41NkM0MS4yOTksNDUuNzM4LTE1Ljc2MywxMzQuNjIzLDMuODY1LDIyNC42NGM3LjI4LDMzLjM5LDI0LjY0LDYzLjczOCw0OS43MzEsODYuOTRDNDkuNTU5LDI5OS4zMTQsNDcuMzUyLDI4Ni41Miw0Ny4wNDYsMjczLjYwOXoiLz4KICAgIDwvZz4KPC9zdmc+"
alt="version"
/></a>
<a href="./LICENSE">
Expand All @@ -22,10 +22,6 @@
/></a>
</h1>

[![PHPStan](https://github.com/The-FireHub-Project/Container/actions/workflows/PHPStan.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Container/actions/workflows/PHPStan.yml)
[![PHPUnit](https://github.com/The-FireHub-Project/Container/actions/workflows/PHPUnit.yml/badge.svg?branch=develop)](https://github.com/The-FireHub-Project/Container/actions/workflows/PHPUnit.yml)
[![Codecov](https://codecov.io/gh/The-FireHub-Project/Container/branch/develop/graph/badge.svg?token=XW2YEONF51)](https://app.codecov.io/gh/The-FireHub-Project/Container/tree/develop)

<p>
<a href="https://github.com/The-FireHub-Project/Container">
<img
Expand Down Expand Up @@ -77,47 +73,69 @@ This repository serves as a foundational runtime component for FireHub applicati

---

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Development Branch
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Repository Purpose

FireHub Container is the dependency injection and service resolution component of the FireHub ecosystem.

Built on the contracts provided by FireHub Core, it supplies the mechanisms required to register, construct, resolve, and manage application services.

The purpose of this repository is to centralize dependency management while preserving separation of concerns between service definitions, runtime implementation, and application execution.

⚠️ **This is the `develop` branch**
The Container architecture is designed to support:

- Unstable
- APIs may change without notice
- Not intended for production use
- Service registration and dependency resolution
- Interface-to-implementation bindings
- Instance, factory, and class-based service definitions
- Singleton and transient service lifetimes
- Dependency graph resolution and circular dependency detection
- Immutable service registrations after container construction
- Future support for autowiring and execution-scoped services

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Branch Purpose
FireHub Container follows the architectural principles of The FireHub Project by separating responsibilities between contracts, dependency management, and application lifecycle orchestration.

The `develop` branch is the **primary integration branch** for all ongoing development.
The Container does not control application execution or kernel lifecycle transitions. Instead, it provides dependency management services that can be integrated into applications through the appropriate bootstrap and composition mechanisms.

It serves as the staging area where:
- Feature branches are merged
- Bug fixes are integrated
- Experimental work is stabilized
- Code is prepared for upcoming releases
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Security

All **release branches** are created **from `develop`**.
For security reporting and guidelines, please refer to our [SECURITY.md](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file.

## Stability Guarantee
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Community

❌ No backward compatibility guarantee
❌ APIs may change without notice
❌ Behavior may be incomplete or inconsistent
❌ Breaking changes are expected
![GitHub watchers](https://img.shields.io/github/watchers/The-FireHub-Project/Container?style=social)
![GitHub Repo stars](https://img.shields.io/github/stars/The-FireHub-Project/Container?style=social)
![GitHub forks](https://img.shields.io/github/forks/The-FireHub-Project/Container?style=social)

This branch is intended **only for contributors and advanced testers**.
- Be sure to review the [Code of Conduct](https://github.com/The-FireHub-Project/.github/blob/master/.github/CODE_OF_CONDUCT.md).
- Read a [Contributing](https://github.com/The-FireHub-Project/.github/blob/master/.github/CONTRIBUTING.md) file to see how you can contribute to this project.
- Read our [Security policy](https://github.com/The-FireHub-Project/.github/blob/master/.github/SECURITY.md) file to see how you can report a vulnerability.
- Review the project [Governance model](https://github.com/The-FireHub-Project/.github/blob/master/.github/GOVERNANCE.md), including roles, decision-making, RFC process, and releases.

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Composer Usage (Not Recommended)
## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Support

<p>
<a href="https://github.com/The-FireHub-Project/Container/issues?q=is%3Aissue%20state%3Aopen">
<img
src="https://img.shields.io/github/issues/The-FireHub-Project/Container?style=flat&logo=github&logoColor=959da5&label=in%20progress%20issues&labelColor=31373e"
alt="GitHub in-progress issues"
/></a>
<a href="https://github.com/The-FireHub-Project/Container/issues?q=is%3Aissue">
<img
src="https://img.shields.io/github/issues-search?query=repo%3AThe-FireHub-Project%Foundaton&style=flat&logo=github&logoColor=959da5&label=total%20issues&labelColor=31373e"
alt="GitHub total issues"
/></a>
<a href="https://github.com/The-FireHub-Project/Container/issues?q=is%3Apr%20is%3Aopen">
<img
src="https://img.shields.io/github/issues-pr/The-FireHub-Project/Container?style=flat&logo=github&logoColor=959da5&labelColor=31373e"
alt="GitHub opened pull requests"
/></a>
</p>

For internal testing only:
For help with FireHub products, please refer to the following resources:

```json
{
"require": {
"the-firehub-project/container": "dev-develop"
}
}
```
⚠️ Never use dev-develop in production.
- **General questions & discussions**: [GitHub Discussions](https://github.com/orgs/The-FireHub-Project/discussions)
- **Bug reports & issues**: [Support](https://github.com/The-FireHub-Project/Container/issues)
- **Documentation & guides**: [FireHub Docs](https://the-firehub-project.github.io)
- **Commercial support** (Pro/Enterprise): contact your account manager

## <img src="https://raw.githubusercontent.com/The-FireHub-Project/the-firehub-project.github.io/master/resources/graphics/icons/firehub.svg" width="15" alt="FireHub Icon"> Authors and Contributors

Expand All @@ -134,4 +152,4 @@ Architecture guidelines, design principles, and ecosystem documentation are avai

This software is licensed under the Apache-2.0 License.

For more details, read the full license [here](./LICENSE).
For more details, read the full license [here](./LICENSE).
Loading
Loading