mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Merge pull request #432 from digitalkaoz/issue_428
fluent api for installer options
This commit is contained in:
commit
6b453906f0
4 changed files with 140 additions and 47 deletions
|
@ -120,7 +120,9 @@ EOT
|
|||
$composer = Factory::create($io);
|
||||
$installer = Installer::create($io, $composer);
|
||||
|
||||
$installer->run($preferSource);
|
||||
$installer
|
||||
->setPreferSource($preferSource)
|
||||
->run();
|
||||
}
|
||||
|
||||
protected function createDownloadManager(IOInterface $io)
|
||||
|
|
|
@ -53,12 +53,14 @@ EOT
|
|||
$io = $this->getApplication()->getIO();
|
||||
$install = Installer::create($io, $composer);
|
||||
|
||||
return $install->run(
|
||||
(Boolean) $input->getOption('prefer-source'),
|
||||
(Boolean) $input->getOption('dry-run'),
|
||||
(Boolean) $input->getOption('verbose'),
|
||||
(Boolean) $input->getOption('no-install-recommends'),
|
||||
(Boolean) $input->getOption('install-suggests')
|
||||
);
|
||||
$install
|
||||
->setDryRun($input->getOption('dry-run'))
|
||||
->setVerbose($input->getOption('verbose'))
|
||||
->setPreferSource($input->getOption('prefer-source'))
|
||||
->setInstallRecommends(!$input->getOption('no-install-recommends'))
|
||||
->setInstallSuggests($input->getOption('install-suggests'))
|
||||
;
|
||||
|
||||
return $install->run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,13 +51,15 @@ EOT
|
|||
$io = $this->getApplication()->getIO();
|
||||
$install = Installer::create($io, $composer);
|
||||
|
||||
return $install->run(
|
||||
(Boolean)$input->getOption('prefer-source'),
|
||||
(Boolean)$input->getOption('dry-run'),
|
||||
(Boolean)$input->getOption('verbose'),
|
||||
(Boolean)$input->getOption('no-install-recommends'),
|
||||
(Boolean)$input->getOption('install-suggests'),
|
||||
true
|
||||
);
|
||||
$install
|
||||
->setDryRun($input->getOption('dry-run'))
|
||||
->setVerbose($input->getOption('verbose'))
|
||||
->setPreferSource($input->getOption('prefer-source'))
|
||||
->setInstallRecommends(!$input->getOption('no-install-recommends'))
|
||||
->setInstallSuggests($input->getOption('install-suggests'))
|
||||
->setUpdate(true)
|
||||
;
|
||||
|
||||
return $install->run();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue