1
0
Fork 0

Load plugins and installers prior to checking installed packages

pull/2179/head
Nils Adermann 2013-08-31 16:20:38 +02:00
parent 2ca07add97
commit bf08019292
3 changed files with 6 additions and 5 deletions

View File

@ -260,6 +260,10 @@ class Factory
// add installers to the manager
$this->createDefaultInstallers($im, $composer, $io);
if (!$disablePlugins) {
$pm->loadInstalledPlugins();
}
// purge packages if they have been deleted on the filesystem
$this->purgePackages($rm, $im);
@ -272,10 +276,6 @@ class Factory
$composer->setLocker($locker);
}
if (!$disablePlugins) {
$pm->loadInstalledPlugins();
}
return $composer;
}

View File

@ -172,7 +172,7 @@ class PluginManager
$generator = $this->composer->getAutoloadGenerator();
$autoloads = array();
foreach ($autoloadPackages as $autoloadPackage) {
$downloadPath = $this->getInstallPath($autoloadPackage, !$localRepo->hasPackage($autoloadPackage));
$downloadPath = $this->getInstallPath($autoloadPackage, ($this->globalRepository && $this->globalRepository->hasPackage($autoloadPackage)));
$autoloads[] = array($autoloadPackage, $downloadPath);
}

View File

@ -69,6 +69,7 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
$config->merge(array(
'config' => array(
'vendor-dir' => __DIR__.'/Fixtures/',
'home' => __DIR__.'/Fixtures',
'bin-dir' => __DIR__.'/Fixtures/bin',
),
));