Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How do you get around the issue of composer creating a 'ComposerClassLoader' for each library created with composer? Seems to break saying class already loaded.
Kim
Comments
Comment #1
boombatower CreditAttribution: boombatower commentedThis is part of the larger issue that the way composer works out of the box (or the way we try to use it with drupal) is fundamentally broken. There is an issue in libraries project queue with discussion on how to fix things properly.
I am not sure if there is a simple workaround we can introduce to make this better.
Comment #2
RobLoachComposer protects against this issue by appending a suffix to the ComposerAutoloaderInit class during generation. PHP's autoloader loads the first Composer ClassLoader class it finds so it doesn't load the file twice.
Comment #3
_wdm_ CreditAttribution: _wdm_ commentedNeeding something that would work for D7 I have created the following module:
http://drupal.org/project/composer_vendor
Comment #4
kim.pepperAccording to @msonnabaum the latest versions don't have colliding ComposerClassLoaders. So this may be resolved.