mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
Refactor some common logic in Command classes
This commit is contained in:
parent
8cf9733001
commit
69740bbbee
4 changed files with 40 additions and 75 deletions
|
@ -89,27 +89,8 @@ EOT
|
|||
|
||||
$install = Installer::create($io, $composer);
|
||||
|
||||
$preferSource = false;
|
||||
$preferDist = false;
|
||||
|
||||
$config = $composer->getConfig();
|
||||
|
||||
switch ($config->get('preferred-install')) {
|
||||
case 'source':
|
||||
$preferSource = true;
|
||||
break;
|
||||
case 'dist':
|
||||
$preferDist = true;
|
||||
break;
|
||||
case 'auto':
|
||||
default:
|
||||
// noop
|
||||
break;
|
||||
}
|
||||
if ($input->getOption('prefer-source') || $input->getOption('prefer-dist')) {
|
||||
$preferSource = $input->getOption('prefer-source');
|
||||
$preferDist = $input->getOption('prefer-dist');
|
||||
}
|
||||
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input);
|
||||
|
||||
$optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
|
||||
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue