1
0
Fork 0

Make create-project install dependencies following optimize-autoloader config setting, fixes #6722

pull/6847/merge
Jordi Boggiano 2017-11-29 15:05:19 +01:00
parent b0922b95af
commit 0de1e21233
1 changed files with 7 additions and 4 deletions

View File

@ -169,7 +169,9 @@ EOT
$composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
}
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($composer->getConfig(), $input);
// use the new config including the newly installed project
$config = $composer->getConfig();
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input);
// install dependencies of the created project
if ($noInstall === false) {
@ -179,7 +181,8 @@ EOT
->setDevMode($installDevPackages)
->setRunScripts(!$noScripts)
->setIgnorePlatformRequirements($ignorePlatformReqs)
->setSuggestedPackagesReporter($this->suggestedPackagesReporter);
->setSuggestedPackagesReporter($this->suggestedPackagesReporter)
->setOptimizeAutoloader($config->get('optimize-autoloader'));
if ($disablePlugins) {
$installer->disablePlugins();
@ -238,10 +241,10 @@ EOT
}
chdir($oldCwd);
$vendorComposerDir = $composer->getConfig()->get('vendor-dir').'/composer';
$vendorComposerDir = $config->get('vendor-dir').'/composer';
if (is_dir($vendorComposerDir) && $fs->isDirEmpty($vendorComposerDir)) {
Silencer::call('rmdir', $vendorComposerDir);
$vendorDir = $composer->getConfig()->get('vendor-dir');
$vendorDir = $config->get('vendor-dir');
if (is_dir($vendorDir) && $fs->isDirEmpty($vendorDir)) {
Silencer::call('rmdir', $vendorDir);
}