PHPackages                             bitexpert/disco - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bitexpert/disco

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bitexpert/disco
===============

Dependency Injection Container

v0.10.0(8y ago)1401.8k16[7 issues](https://github.com/bitExpert/disco/issues)[2 PRs](https://github.com/bitExpert/disco/pulls)3Apache-2.0PHPPHP ^7.2.0CI failing

Since Nov 3Pushed 3mo ago14 watchersCompare

[ Source](https://github.com/bitExpert/disco)[ Packagist](https://packagist.org/packages/bitexpert/disco)[ RSS](/packages/bitexpert-disco/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (29)Used By (3)

bitexpert/disco
===============

[](#bitexpertdisco)

This package provides a [PSR-11](http://www.php-fig.org/psr/psr-11/) compatible, annotation-based dependency injection container. Have a look at the [disco-demos](https://github.com/bitExpert/disco-demos) project to find out how to use Disco.

[![Build Status](https://github.com/bitExpert/disco/workflows/ci/badge.svg?branch=master)](https://github.com/bitExpert/disco/actions)[![Coverage Status](https://camo.githubusercontent.com/98c202a71940f29548a2060d844fd2f4d95480b1391d5777ce8e25846dab0a69/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6269744578706572742f646973636f2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bitExpert/disco?branch=master)[![Mastodon Follow](https://camo.githubusercontent.com/c2abd2d790b2fdf042e992e8872c59044086bdb16b119a61d8526d6238c3c2ba/68747470733a2f2f696d672e736869656c64732e696f2f6d6173746f646f6e2f666f6c6c6f772f3130393430383638313234363937323730303f646f6d61696e3d68747470733a2f2f726865696e6e65636b61722e736f6369616c)](https://rheinneckar.social/@bitexpert)

Installation
------------

[](#installation)

The preferred way of installing `bitexpert/disco` is through Composer. You can add `bitexpert/disco` as a dependency, as follows:

```
composer.phar require bitexpert/disco

```

Usage
-----

[](#usage)

To instantiate Disco use the following code in your bootstrapping logic. Create an instance of the `\bitExpert\Disco\AnnotationBeanFactory` and register the instance with the `\bitExpert\Disco\BeanFactoryRegistry`. The second step is important as Disco needs to grab the active container instance in a few locations where it does not have access to the container instance itself.

```
