Releases: PHP-DI/PHP-DI
Releases · PHP-DI/PHP-DI
3.1.0
Read the news entry.
- Zend Framework 1 integration through the PHP-DI-ZF1 project
- Fixed the order of priorities when you mix different definition sources (reflection, annotations, files, …). See Definition overriding
- Now possible to define null values with
$container->set('foo', null)(see #79). - Deprecated usage of
ContainerSingleton, will be removed in next major version (4.0)
3.0.0
Major compatibility breaks with 2.x.
- The container is no longer a Singleton (but
ContainerSingleton::getInstance()is available for fools who like it) - Setter injection
- Constructor injection
- Scopes: singleton (share the same instance of the class) or prototype (create a new instance each time it is fetched). Defined at class level.
- Configuration is reworked from scratch. Now every configuration backend can do 100% of the job.
- Provided configuration backends:
- Reflection
- Annotations: @Inject, @Injectable
- PHP code (
Container::set()) - PHP array
- YAML file
- As a consequence, annotations are not mandatory anymore, all functionalities can be used with or without annotations.
- Renamed
DI\Annotations\toDI\Annotation\ Containerno longer implements ArrayAccess, use only$container->get($key)now- ZF1 integration broken and removed (work in progress for next releases)
- Code now follows PSR1 and PSR2 coding styles
- FIXED: #58 Getting a proxy of an alias didn't work
2.0.0
Major compatibility breaks with 1.x.
Container::resolveDependencies()has been renamed toContainer::injectAll()- Dependencies are now injected before the constructor is called, and thus are available in the constructor
- Merged
@Valueannotation with@Inject: no difference between value and bean injection anymore - Container implements ArrayAccess for get() and set() (
$container['db.host'] = 'localhost';) - Ini configuration files removed: configuration is done in PHP
- Allow to define beans within closures for lazy-loading
- Switched to MIT License