Download the PHP package php-di/zf2-bridge without Composer
On this page you can find all versions of the php package php-di/zf2-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-di/zf2-bridge
More information about php-di/zf2-bridge
Files in php-di/zf2-bridge
Package zf2-bridge
Short Description Integrates PHP-DI to Zend Framework 2
License MIT
Homepage https://github.com/PHP-DI/ZF2-Bridge
Informations about the package zf2-bridge
PHP-DI integration with Zend Framework 2
This library provides integration for PHP-DI with Zend Framework 2.
PHP-DI is a Dependency Injection Container for PHP.
If you are looking for Zend Framework 1 integration, head over here.
Use
Require the libraries with Composer:
To use PHP-DI in your ZF2 application, you need to edit application_root/config/application.config.php
:
That's it!
Now you dependencies are injected in your controllers!
If you'd like to specify the di configuration yourself, create this file: application_root/config/php-di.config.php
and save it with your PHP DI configuration e.g. like this:
Head over to PHP-DI's documentation if needed.
Fine tuning
To configure the module, you have to override the module config somewhere at config/autoload/global.php or config/autoload/local.php.
Override definitions file location
Enable or disable annotations
Enable APCu
Enable file cache
Enable redis cache
If you are also using Redis for storing php sessions, it is very useful to configure the php-di cache handler to use a different database, since you might accidentally delete all your sessions when clearing the php-di definitions cache.
Enable Memcached cache
If you're using Memcached, you should have only one project per memcached instance.
Console commands
Clear definition cache
To clear the definition cache, run the following command from the project root:
All versions of zf2-bridge with dependencies
php-di/php-di Version ~5.0
acclimate/container Version ~1.0 || ~2.0
doctrine/annotations Version ~1.0
doctrine/cache Version ~1.0