PHPackages                             dhii/di - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. dhii/di

Abandoned → [dhii/containers](/?search=dhii%2Fcontainers)ArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

dhii/di
=======

A DI container implementation

v0.1.1(9y ago)13.7k↓14.3%1MITPHPPHP ^5.3 | ^7.0

Since Feb 2Pushed 6y ago4 watchersCompare

[ Source](https://github.com/Dhii/di)[ Packagist](https://packagist.org/packages/dhii/di)[ RSS](/packages/dhii-di/feed)WikiDiscussions develop Synced today

READMEChangelog (3)Dependencies (8)Versions (7)Used By (0)

Dhii - DI
=========

[](#dhii---di)

[![Build Status](https://camo.githubusercontent.com/cf1d4abb9615fa41adb6fca522a7050eb7ee5870445e893c89cba1c590ae3825/68747470733a2f2f7472617669732d63692e6f72672f446869692f64692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Dhii/di)[![Code Climate](https://camo.githubusercontent.com/e5434792ed874aa14ca27fe39de239730483327a419d819e245bfb6d8ab86175/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f64692f6261646765732f6770612e737667)](https://codeclimate.com/github/Dhii/di)[![Test Coverage](https://camo.githubusercontent.com/e808deb57250ad9de91bd95480f56964e140c1647151e678aacb7b20284a8a14/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f64692f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/Dhii/di/coverage)[![Join the chat at https://gitter.im/Dhii/di](https://camo.githubusercontent.com/f122ac7f0c03753e171113584a0e820868e132bf1e20361c75f2cf72b110c983/68747470733a2f2f6261646765732e6769747465722e696d2f446869692f64692e737667)](https://gitter.im/Dhii/di?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![This package complies with Dhii standards](https://camo.githubusercontent.com/44bbe8c7678c1784cfc53cabce5d3e32fc22a840453c5ed9c08601522fe7c213/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446869692d436f6d706c69616e742d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Dhii/dhii)

Details
-------

[](#details)

Simple, granular, standards-compliant DI container implementations.

### Features

[](#features)

- Is an implementation of the [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md) standard.
- Uses some other [standards](https://packagist.org/packages/dhii/data-container-interface) published separately.
- Includes support for the [delegate lookup](https://github.com/container-interop/container-interop/blob/master/docs/Delegate-lookup-meta.md) feature, a.k.a. composite containers, with intuitive override order.
- Easily extensible and adaptable.

### Classes

[](#classes)

- [`CachingContainer`](src/CachingContainer.php) - A simple container that resolves callable service definitions and caches the result, guaranteeing the same instance every time. [Cache sold separately](https://github.com/Dhii/memoize-memory).
- [`ContainerAwareCachingContainer`](src/ContainerAwareCachingContainer.php) - A container that is aware of another container, perhaps a parent one. Callable definitions will receive the top-most parent container of the chain when resolving. Use it with [`CompositeContainer`](https://github.com/Dhii/composite-container/blob/develop/src/CompositeContainer.php) to implement the
- [`AbstractBaseContainer`](src/AbstractBaseContainer.php) - Common functionality for DI containers that store services as internal data.
- [`AbstractBaseCachingContainer`](src/AbstractBaseCachingContainer.php) - Common functionality for DI containers that cache resolved services.

###  Health Score

29

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~275 days

Total

4

Last Release

2510d ago

PHP version history (3 changes)v0.1PHP ^5.3 | ^7.0

v0.2-alpha1PHP ^5.4 | ^7.0

0.3.x-devPHP ^7.0 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1894e91b32c9f80d8f30a42d360af6983a507f1cf2c621b7c9a0a0de14e011c5?d=identicon)[XedinUnknown](/maintainers/XedinUnknown)

---

Top Contributors

[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (83 commits)")[![mecha](https://avatars.githubusercontent.com/u/5425482?v=4)](https://github.com/mecha "mecha (47 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

dependency-injectionfactorystandard-conformcontainerdependency-injectiondi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dhii-di/health.svg)

```
[![Health](https://phpackages.com/badges/dhii-di/health.svg)](https://phpackages.com/packages/dhii-di)
```

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k47.0M879](/packages/php-di-php-di)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

357963.4k52](/packages/aura-di)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.3M2](/packages/mrclay-props-dic)[slince/di

A flexible dependency injection container

20256.7k5](/packages/slince-di)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2856.2k2](/packages/capsule-di)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
