Merge branch '1.5'
commit
b59dd23bb4
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -744,10 +744,6 @@ class RemoteFilesystem
|
|||
$headers[] = 'Connection: close';
|
||||
}
|
||||
|
||||
if (isset($userlandFollow)) {
|
||||
$options['http']['follow_location'] = 0;
|
||||
}
|
||||
|
||||
if ($this->io->hasAuthentication($originUrl)) {
|
||||
$auth = $this->io->getAuthentication($originUrl);
|
||||
if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
|
||||
|
@ -768,6 +764,11 @@ class RemoteFilesystem
|
|||
$authStr = base64_encode($auth['username'] . ':' . $auth['password']);
|
||||
$headers[] = 'Authorization: Basic '.$authStr;
|
||||
}
|
||||
$userlandFollow = true; // always perform userland follow (to be able to change Authorization headers when redirected)
|
||||
}
|
||||
|
||||
if (isset($userlandFollow)) {
|
||||
$options['http']['follow_location'] = 0;
|
||||
}
|
||||
|
||||
if (isset($options['http']['header']) && !is_array($options['http']['header'])) {
|
||||
|
@ -810,7 +811,7 @@ class RemoteFilesystem
|
|||
|
||||
$additionalOptions['redirects'] = $this->redirects;
|
||||
|
||||
return $this->get($this->originUrl, $targetUrl, $additionalOptions, $this->fileName, $this->progress);
|
||||
return $this->get(parse_url($targetUrl, PHP_URL_HOST), $targetUrl, $additionalOptions, $this->fileName, $this->progress);
|
||||
}
|
||||
|
||||
if (!$this->retry) {
|
||||
|
|
Loading…
Reference in New Issue