Prepend runtime-autoloaders so that dependencies get loaded over Composer bundled packages
As Composer is generally compatible with newer versions of Symfony than the bundled ones, this should not be a problem if dependencies are shared, and it ensures that the most relevant code gets loaded.pull/9696/head
parent
27d0c5c3ef
commit
d4073a40f9
|
@ -517,9 +517,9 @@ EOF;
|
|||
* @param array $autoloads see parseAutoloads return value
|
||||
* @return ClassLoader
|
||||
*/
|
||||
public function createLoader(array $autoloads)
|
||||
public function createLoader(array $autoloads, $vendorDir = null)
|
||||
{
|
||||
$loader = new ClassLoader();
|
||||
$loader = new ClassLoader($vendorDir);
|
||||
|
||||
if (isset($autoloads['psr-0'])) {
|
||||
foreach ($autoloads['psr-0'] as $namespace => $path) {
|
||||
|
|
|
@ -435,8 +435,8 @@ class EventDispatcher
|
|||
$packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
|
||||
$packageMap = $generator->buildPackageMap($this->composer->getInstallationManager(), $package, $packages);
|
||||
$map = $generator->parseAutoloads($packageMap, $package);
|
||||
$this->loader = $generator->createLoader($map);
|
||||
$this->loader->register();
|
||||
$this->loader = $generator->createLoader($map, $this->composer->getConfig()->get('vendor-dir'));
|
||||
$this->loader->register(true);
|
||||
|
||||
return $scripts[$event->getName()];
|
||||
}
|
||||
|
|
|
@ -198,8 +198,8 @@ class PluginManager
|
|||
}
|
||||
|
||||
$map = $generator->parseAutoloads($autoloads, $rootPackage);
|
||||
$classLoader = $generator->createLoader($map);
|
||||
$classLoader->register();
|
||||
$classLoader = $generator->createLoader($map, $this->composer->getConfig()->get('vendor-dir'));
|
||||
$classLoader->register(true);
|
||||
|
||||
foreach ($classes as $class) {
|
||||
if (class_exists($class, false)) {
|
||||
|
|
Loading…
Reference in New Issue