Closed hanneswernery closed 5 years ago
Danger run resulted in 1 warning; to find out more, see the checks page.
Generated by :no_entry_sign: dangerJS
Looks good. Once you've manually tested everything again and verified that Shopware's tests pass, you can open the PR against https://github.com/shopware/platform!
Upstream PR is here: https://github.com/shopware/platform/pull/25
This PR does two things.
(1)
When installing a plugin to the
custom/plugins
directory, Shopware will then try to verify that Shopware's main composervendor/
folder contains all dependencies specified in that plugin'scomposer.json
. This is problematic since plugins may be distributed as e.g. ZIP files which ship their ownvendor/
directory, which may include additional libraries. In this case, even though the plugin ships its own dependencies, Shopware will refuse to install the plugin.This PR fixes this issue by only validating composer dependencies for plugins which are
managedByComposer
. This way, Shopware validates plugin dependencies if and only if the plugin is installed into the Shopware installation using composer.(2)
shopware/development's
composer.json
addscustom/plugins
as an additonal repository: https://github.com/shopware/development/blob/55cc7cb310d16e0bc614bfcfe108e0686ccbe586/composer.json#L9-L15This allows shop administrators to
composer require
plugins which reside incustom/plugins
into Shopware'svendor/
directory, resolving the plugins' dependencies and generating optimized classmaps in the process. However, if you try this and then runbin/console plugin:refresh
, this will fail with a unique constraint violation because thePluginFinder
tries to add the plugin fromcustom/plugins
as well as from thevendor/
directory.To fix this, this PR resolves these conflicts by always preferring plugins installed into the
vendor/
folder over those installed incustom/plugins
.