netz98 / n98-magerun

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.
http://magerun.net/
Other
1.44k stars 400 forks source link

Composer conflict #1002

Closed kgoedecke closed 2 months ago

kgoedecke commented 6 years ago

Can we please update "symfony/console": "~2.3", to at least version 3, I'm facing conflicts because other packages depend on 3.x.

cmuench commented 6 years ago

That is a comedy topic. We have to support multiple Magento versions at once. At the moment we are searching a solution to support the tool for Magento 2.3 where we face the same problem.

kgoedecke commented 6 years ago

Thanks for getting back to me. Is there at least a branch which can be used with 3.x?

cmuench commented 6 years ago

No. btw... I don't understand why so many ppl install n98-magerun with composer. One of the main ideas of the tool is that e.g. an admin can use it without any code or config change of the shop installation. We always recommend to use the phar version.

hostep commented 6 years ago

I don't understand why so many ppl install n98-magerun with composer.

Because there is a composer.json file and the packages are published on https://packagist.org/ ? 😉

No worries, I understand the difficulties here, using the phar file directly is a better way to manage these kind of utilities then composer, even though composer is really easy for upgrading packages and not forgetting about upgrading them.

cmuench commented 6 years ago

@hostep Yes, as we published the composer package, we was able to support the existing Magento versions. At the moment we have trouble to support every used Symfony version in the wild. If it is a solution, we could drop the composer support. How can we support Symfony 2.x, 3.x, 4.x, ... components at once?

Morgon commented 5 years ago

btw... I don't understand why so many ppl install n98-magerun with composer.

FWIW, I install via composer in my local environment so I can have access to it within any project, and composer 'manages' it (executable paths, updates, etc).

hostep commented 5 years ago

It's more of a problem with composer then the magerun tool itself. Magerun and Magento are two separate things, even though magerun can communicate with Magento, it doesn't necessarily mean that dependencies of both products should be the same or compatible for that matter. Composer doesn't know how to deal with these kind of situations unfortunately.

There are however some composer plugins which can possibly deal with this a bit better, I tried those out about a year ago if I remember correctly, but there were some things I didn't quite like back then, maybe I should give them another try again, the ones I'm talking about are:

Not sure if this is really helpful in this thread.

sreichel commented 5 years ago

How can we support Symfony 2.x, 3.x, 4.x, ... components at once?

Do you need to support all versions? 2.3 is EOL since mid 2017 (and should be replaced?)

I had confilcts with phpstan that uses symfony 3,2/4.0 components so i tried to change Magerun requirements to same ... and it seems there is only one (?) problem with a deprecated/removed "TableHelper" class ...

  1. change N98/Util/Console/Helper/TableHelper.php to extend use Symfony\Component\Console\Helper\Table
  2. change N98/Magento/Application.php to match parent constructor (change: : new $helperClass() to: : new $helperClass(new ConsoleOutput)
  3. add (empty) missing interface methods to N98/Util/Console/Helper/TableHelper.php

... seems to work with symfony 4.x ... :)

Maybe someone can check this before i create a PR?

cmuench commented 5 years ago

@sreichel Thanks for investigate that problem. I personally use the phar edition of n98-magerun. In the past we had a lot of issues to be compatible between several Magento releases. That's why we have this long list of travis jobs...

sreichel commented 5 years ago

I use phar too, but it still would be nice if composer version would work with more recent setups :)

(same for phpunit 4.x)

hostep commented 5 years ago

I agree with @sreichel here, it would be nice if the latest version of magerun2 could have non-conflicting dependencies with the latest version of Magento2. That would mean it will be installable using composer again, but only on more recent versions of Magento2. Right now it's the opposite, it's only installable with composer on older versions of Magento2.

This would also have the benefit of using newer functionalities of newer versions of symfony components, should these come in handy. And would also mean you are using supported versions of these components.

Just a nice to have if it wouldn't take that much time to upgrade them, but I'm seeing @sreichel is already working on a pull request for this 👍

Update: sorry, just noticed this issue is about magerun1 and Magento1, my bad!

cmuench commented 4 years ago

@sreichel @hostep I already started to update the dependencies. The next n98-magerun release will only be tested with latest OpenMage release. Then we can try to update the Symfony dependencies as well.

I already upgraded all tests to be compatible with PHPUnit 6.x. Next step is 8.x That's also needed to upgrade to the latest Symfony versions.

sreichel commented 2 months ago

Think this can be closed. Develop branch uses symfony/xyz 5.4.