-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Expressive Skeleton installer with PHP-DI results in error? #25
Comments
Thank you for your feedback. I am using PHP-DI with zend framework and zend expressive with no issues. However, you may need container-interop as suggested by zend expressive if you want to use lazy or Abstract Factory. I tried now the installation with composer serve and everything works correctly: |
@elie29 thanks for the swift response. Will try again coming week and report back here. Probably I did something wrong 😉 |
It seems related to my preference to use
This involves While the PHP-DI container implements Workarounds:
Not sure whether a solution exists other then "waiting" |
@holtkamp thank you for the report. I don't really use zend_view. However, zend-view involves zend-service-manager whose uses obsoleted interop-container. Second, zend service acts as a container so I don't see the interest of using many containers in the same project. I will close this issue as it is not related to this package we should wait zend service upgrade. |
You need to decorate your PSR container for Interop container compatibility, see this comment |
No need for a decorator. Aliasing with Psr container is enough |
Until zend service manager release version 4, we have to wrap DI\Container by implementing Interop\Container\ContainerInterface |
@holtkamp I released a new version with the wrapper would you please test https://github.com/elie29/zend-di-config/releases/tag/v3.0.9 |
@elie29 works perfectly! Very elegant approach, compliments 👍 |
@holtkamp thank you for testing the version. We can promote it now! |
I have some experience with PHP-DI and now try to use it with Zend Expressive.
When using
composer create-project zendframework/zend-expressive-skeleton expressive-project
and selecting PHP-DI as DependencyInjectionContainer, the default installation seems to result in an error:composer serve
=> then open gives:I tried the instructions at https://github.com/elie29/zend-di-config#using-with-expressive
apparently
Interop\Container\ContainerInterface
is required byZend\ServiceManager\AbstractPluginManager::__construct()
, while the PHP-DI container implementsPsr\Container\ContainerInterface
.but am kind of stuck here... Any suggestions? Are the involved libraries still compatible?
Should Zend Expressive switch the the PSR-11 approach?
https://github.com/container-interop/container-interop
The text was updated successfully, but these errors were encountered: