magento-composer-installer icon indicating copy to clipboard operation
magento-composer-installer copied to clipboard

Conflict with symfony

Open dvdsndr opened this issue 5 years ago • 2 comments

Many Magento 1.9.X sites use composer and n98-magerun to manage their installations.

There is some conflict with the symfony framework using the latest php7.3 compatible magerun.

We get the following from n98-magerun:

PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Console\Command\HelpCommand::isHidden() in /var/www/magento/vendor/symfony/console/Descriptor/ApplicationDescription.php:108 Stack trace:

If rename the symfony folder loaded by compose-installer then the problem goes away. I can only assume that both composer-installer and magerun are using incompatible versions and the compose-installer Symfony version is already loaded thus magerun gets the wrong version.

dvdsndr avatar Feb 18 '20 16:02 dvdsndr

I encountered the same issue. Also, when I upgraded to the latest version of the Magento Composer Installer with all of its dependencies, most importantly Symfony Console 5, I got another error related to Symfony Console:

PHP Fatal error: Class 'Symfony\Contracts\EventDispatcher\Event' not found in /path/to/magento/vendor/symfony/console/Event/ConsoleEvent.php on line 24

It turns out that it is an issue in n98-magerun, which has been fixed in version 1.99.0. From the changelog:

Fix: Fatal error w/ Magento Composer Installer (by Luke Rodgers and Tom Klingenberg, #938)

More precisely, commit 6d42ba5 resolved the issue.

So, in order to fix the issue you need to upgrade n98-magerun to at least v1.99.0.

aadmathijssen avatar Sep 03 '20 18:09 aadmathijssen

I will reduce the possible dependency issues with the migration to composer V2

Flyingmana avatar Oct 28 '20 08:10 Flyingmana