• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H03-May-2022-595426

src/Interop/Container/H03-May-2022-4818

.gitignoreH A D14-Feb-201737 43

LICENSEH A D14-Feb-20171.1 KiB2116

README.mdH A D14-Feb-20178.5 KiB149111

composer.jsonH A D14-Feb-2017434 1615

README.md

1# Container Interoperability
2
3[![Latest Stable Version](https://poser.pugx.org/container-interop/container-interop/v/stable.png)](https://packagist.org/packages/container-interop/container-interop)
4[![Total Downloads](https://poser.pugx.org/container-interop/container-interop/downloads.svg)](https://packagist.org/packages/container-interop/container-interop)
5
6## Deprecation warning!
7
8Starting Feb. 13th 2017, container-interop is officially deprecated in favor of [PSR-11](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md).
9Container-interop has been the test-bed of PSR-11. From v1.2, container-interop directly extends PSR-11 interfaces.
10Therefore, all containers implementing container-interop are now *de-facto* compatible with PSR-11.
11
12- Projects implementing container-interop interfaces are encouraged to directly implement PSR-11 interfaces instead.
13- Projects consuming container-interop interfaces are very strongly encouraged to directly type-hint on PSR-11 interfaces, in order to be compatible with PSR-11 containers that are not compatible with container-interop.
14
15Regarding the delegate lookup feature, that is present in container-interop and not in PSR-11, the feature is actually a design pattern. It is therefore not deprecated. Documentation regarding this design pattern will be migrated from this repository into a separate website in the future.
16
17## About
18
19*container-interop* tries to identify and standardize features in *container* objects (service locators,
20dependency injection containers, etc.) to achieve interoperability.
21
22Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.
23
24If PHP projects that provide container implementations begin to adopt these common standards, then PHP
25applications and projects that use containers can depend on the common interfaces instead of specific
26implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume
27*any* container implementation that can be adapted to these interfaces.
28
29The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being
30worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope
31this project will pave the way for one or more future PSRs.
32
33
34## Installation
35
36You can install this package through Composer:
37
38```json
39composer require container-interop/container-interop
40```
41
42The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility
43between minor versions.
44
45## Standards
46
47### Available
48
49- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php).
50[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md).
51Describes the interface of a container that exposes methods to read its entries.
52- [*Delegate lookup feature*](docs/Delegate-lookup.md).
53[Meta Document](docs/Delegate-lookup-meta.md).
54Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This
55feature lets several containers work together in a single application.
56
57### Proposed
58
59View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC)
60
61## Compatible projects
62
63### Projects implementing `ContainerInterface`
64
65- [Acclimate](https://github.com/jeremeamia/acclimate-container): Adapters for
66  Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2
67  Dependency injection and any container using `ArrayAccess`
68- [Aura.Di](https://github.com/auraphp/Aura.Di)
69- [auryn-container-interop](https://github.com/elazar/auryn-container-interop)
70- [Burlap](https://github.com/codeeverything/burlap)
71- [Chernozem](https://github.com/pyrsmk/Chernozem)
72- [Data Manager](https://github.com/chrismichaels84/data-manager)
73- [Disco](https://github.com/bitexpert/disco)
74- [InDI](https://github.com/idealogica/indi)
75- [League/Container](http://container.thephpleague.com/)
76- [Mouf](http://mouf-php.com)
77- [Njasm Container](https://github.com/njasm/container)
78- [PHP-DI](http://php-di.org)
79- [Picotainer](https://github.com/thecodingmachine/picotainer)
80- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
81- [Pimple3-ContainerInterop](https://github.com/Sam-Burns/pimple3-containerinterop) (using Pimple v3)
82- [SitePoint Container](https://github.com/sitepoint/Container)
83- [Thruster Container](https://github.com/ThrusterIO/container) (PHP7 only)
84- [Ultra-Lite Container](https://github.com/ultra-lite/container)
85- [Unbox](https://github.com/mindplay-dk/unbox)
86- [XStatic](https://github.com/jeremeamia/xstatic)
87- [Zend\ServiceManager](https://github.com/zendframework/zend-servicemanager)
88- [Zit](https://github.com/inxilpro/Zit)
89
90### Projects implementing the *delegate lookup* feature
91
92- [Aura.Di](https://github.com/auraphp/Aura.Di)
93- [Burlap](https://github.com/codeeverything/burlap)
94- [Chernozem](https://github.com/pyrsmk/Chernozem)
95- [InDI](https://github.com/idealogica/indi)
96- [League/Container](http://container.thephpleague.com/)
97- [Mouf](http://mouf-php.com)
98- [Picotainer](https://github.com/thecodingmachine/picotainer)
99- [PHP-DI](http://php-di.org)
100- [PimpleInterop](https://github.com/moufmouf/pimple-interop)
101- [Ultra-Lite Container](https://github.com/ultra-lite/container)
102
103### Middlewares implementing `ContainerInterface`
104
105- [Alias-Container](https://github.com/thecodingmachine/alias-container): add
106  aliases support to any container
107- [Prefixer-Container](https://github.com/thecodingmachine/prefixer-container):
108  dynamically prefix identifiers
109- [Lazy-Container](https://github.com/snapshotpl/lazy-container): lazy services
110
111### Projects using `ContainerInterface`
112
113The list below contains only a sample of all the projects consuming `ContainerInterface`. For a more complete list have a look [here](http://packanalyst.com/class?q=Interop%5CContainer%5CContainerInterface).
114
115| | Downloads |
116| --- | --- |
117| [Adroit](https://github.com/bitexpert/adroit) | ![](https://img.shields.io/packagist/dt/bitexpert/adroit.svg) |
118| [Behat](https://github.com/Behat/Behat/pull/974) | ![](https://img.shields.io/packagist/dt/behat/behat.svg) |
119| [blast-facades](https://github.com/phpthinktank/blast-facades): Minimize complexity and represent dependencies as facades. | ![](https://img.shields.io/packagist/dt/blast/facades.svg) |
120| [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di): an extension to [Silex](http://silex.sensiolabs.org/) that adds support for any *container-interop* compatible container | ![](https://img.shields.io/packagist/dt/mouf/interop.silex.di.svg) |
121| [mindplay/walkway](https://github.com/mindplay-dk/walkway): a modular request router | ![](https://img.shields.io/packagist/dt/mindplay/walkway.svg) |
122| [mindplay/middleman](https://github.com/mindplay-dk/middleman): minimalist PSR-7 middleware dispatcher | ![](https://img.shields.io/packagist/dt/mindplay/middleman.svg) |
123| [PHP-DI/Invoker](https://github.com/PHP-DI/Invoker): extensible and configurable invoker/dispatcher | ![](https://img.shields.io/packagist/dt/php-di/invoker.svg) |
124| [Prophiler](https://github.com/fabfuel/prophiler) | ![](https://img.shields.io/packagist/dt/fabfuel/prophiler.svg) |
125| [Silly](https://github.com/mnapoli/silly): CLI micro-framework | ![](https://img.shields.io/packagist/dt/mnapoli/silly.svg) |
126| [Slim v3](https://github.com/slimphp/Slim) | ![](https://img.shields.io/packagist/dt/slim/slim.svg) |
127| [Splash](http://mouf-php.com/packages/mouf/mvc.splash-common/version/8.0-dev/README.md) | ![](https://img.shields.io/packagist/dt/mouf/mvc.splash-common.svg) |
128| [Woohoo Labs. Harmony](https://github.com/woohoolabs/harmony): a flexible micro-framework | ![](https://img.shields.io/packagist/dt/woohoolabs/harmony.svg) |
129| [zend-expressive](https://github.com/zendframework/zend-expressive) | ![](https://img.shields.io/packagist/dt/zendframework/zend-expressive.svg) |
130
131
132## Workflow
133
134Everyone is welcome to join and contribute.
135
136The general workflow looks like this:
137
1381. Someone opens a discussion (GitHub issue) to suggest an interface
1391. Feedback is gathered
1401. The interface is added to a development branch
1411. We release alpha versions so that the interface can be experimented with
1421. Discussions and edits ensue until the interface is deemed stable by a general consensus
1431. A new minor version of the package is released
144
145We try to not break BC by creating new interfaces instead of editing existing ones.
146
147While we currently work on interfaces, we are open to anything that might help towards interoperability, may that
148be code, best practices, etc.
149