-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
There is no way to use PHP 7.2 or 7.3 #35934
Comments
Possible Solution: add depending "laminas/laminas-code". |
I'm not getting any error on PHP 7.3 (I'm getting a composer warning about |
Perhaps this is my local problem. It does not install "zendframework/zend-code" and I do not see a warning. But it is installed if I install new Symfony project and then I see a warning about "zend-code". I tried to delete "vendor" folder and run While I do not know how you can reproduce it. |
What is the exact error that you get locally? |
I think a dependency is written somewhere as a |
My composer.json:
|
What is the output of |
If I add requirement
this solves the problem for me. |
I fail to see how you ended up with |
Try |
Now I have always installed |
In my opinion the problem is that laminas repositories declare themselves as replacement for zend packages, but that is not true since they have different namespaces... Cc @Ocramius @weierophinney It should be possible to install zend and laminas packages together |
There's a bridge library that aliases package classes for this purpose: https://github.com/laminas/laminas-zendframework-bridge |
Similar error report doctrine/DoctrineMigrationsBundle#300 |
@goetas They actually are replacements. Here's why. Every single Laminas package release includes the package laminas/laminas-zendframework-bridge as a dependency. This package includes two autoloaders:
There's more on this on a blog post we just released today: https://getlaminas.org/blog/2020-03-09-transferring-zf-to-laminas.html |
Quite unfortunate decision, but I guess that other options were considered... Thanks for the feedback @Ocramius |
@goetas Yes — but note the first thing I said: every Laminas package adds the bridge package as a dependency. You cannot install any of them without it. I'd love to hear why you feel it's an "unfortunate decision". Feel free to contact me directly (matthew [at] weierophinney [dot] net), so we don't pollute this issue. That said, please be aware we did extensive testing, particularly with a variety of 3rd party libraries, before going with this approach. It was not an arbitrary decision. |
Sounds good, doesn't work (in all circumstances). Like using authoritive classmap ( |
Further investigating, and I'm not sure it's the authoritive flag: $ rm -rf var/cache/prod/ vendor/
# no optimisation
$ php ../composer-stable.phar install --no-dev
# you need to have at least 1 migration to run
$ php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
# PHP Fatal error: Class 'Zend\Code\Generator\ClassGenerator' not found in .../vendor/ocramius/proxy-manager/src/ProxyManager/Generator/ClassGenerator.php on line 15
# 11:22:56 CRITICAL [php] Fatal Error: Class 'Zend\Code\Generator\ClassGenerator' not found ["exception" => Symfony\Component\ErrorHandler\Error\FatalError^ { …}]
$ php ../composer-stable.phar dump-autoload
$ php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
# finished in 261.3ms
# ++ used 16M memory
# ++ 1 migrations executed
# ++ 1 sql queries |
@mmarton @andchir according to laminas/laminas-zendframework-bridge#64 this might be an issue in the composer autoload generation for Composer < 1.10. Can you confirm whether using Composer 1.10+ fixes it ? You could post the answer directly to the laminas issue. |
@stof can confirm that updating to Composer 1.10+ fixes this issue, we were having the exact same issue with Mautic: mautic/mautic#8826 (comment) Thanks a lot for the info 🚀 |
Symfony version(s) affected: ALL
Description
Symfony depends on "ocramius/proxy-manager", proxy-manager 2.2 depends on "zendframework/zend-code", but "zendframework/zend-code" abandoned https://packagist.org/packages/zendframework/zend-code
Newer versions of "proxy-manager" use "laminas/laminas-code", but they require PHP 7.4 only.
How to reproduce
Try using PHP 7.2 or 7.3. I got error:
Because the package "zendframework/zend-code" abandoned.
Possible Solution
Refuse to use "proxy-manager" because he is always in a hurry to use only the latest versions of PHP. Look for another replacement or develop your own solution. Or ask the author not to rush to use the latest versions of PHP.
The text was updated successfully, but these errors were encountered: