aimeos / aimeos-core

Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org
Other
3.4k stars 118 forks source link

Require the existence of function getInstalledPackagesByType #255

Closed lgeorget closed 3 years ago

lgeorget commented 3 years ago

Hi!

We've run into an annoying bug after the update to Aimeos 2021.07, the extensions which have moved from ext/ to vendor/aimeos were correctly autoloaded by Composer but the other assets were not, because they were not discovered by Aimeos (in https://github.com/aimeos/aimeos-core/blob/master/Bootstrap.php#L33).

What happens is that if the composer version is too old (i.e. it doesn't satisfy the requirements of composer-runtime-api ^2.1), the class \Composer\InstalledVersions doesn't have a getInstalledPackagesByType() function and Aimeos extensions in the vendor/ directory are not loaded.

One way to warn users about that is to require composer-runtime-api ^2.1 to prevent updating Aimeos without a recent enough Composer (this is what this commit does), or maybe to polyfill getInstalledPackagesByType().

What do you guys think?

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-2.3%) to 85.912% when pulling 0a2f5f1f68bb32472aff02c437e97981d7bd4c3e on Meteo-Concept:master into 54ff889b2028c3b95bcf52bbe8c22673fe899b2b on aimeos:master.

aimeos commented 3 years ago

We ask ourselves why we didn't add that before ;-)