mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Allow to pass a string for apcu-autoloader to set the APCu prefix
This commit is contained in:
parent
bd2f321527
commit
dafd225a35
8 changed files with 70 additions and 21 deletions
|
@ -59,7 +59,7 @@ class UpdateCommand extends BaseCommand
|
|||
new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'),
|
||||
new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'),
|
||||
new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'),
|
||||
new InputOption('apcu-autoloader', null, InputOption::VALUE_NONE, 'Use APCu to cache found/not-found classes.'),
|
||||
new InputOption('apcu-autoloader', null, InputOption::VALUE_OPTIONAL, 'Use APCu to cache found/not-found classes (passing a string sets the APCu prefix)'),
|
||||
new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
|
||||
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
|
||||
new InputOption('prefer-stable', null, InputOption::VALUE_NONE, 'Prefer stable versions of dependencies.'),
|
||||
|
@ -189,7 +189,7 @@ EOT
|
|||
|
||||
$optimize = $input->getOption('optimize-autoloader') || $config->get('optimize-autoloader');
|
||||
$authoritative = $input->getOption('classmap-authoritative') || $config->get('classmap-authoritative');
|
||||
$apcu = $input->getOption('apcu-autoloader') || $config->get('apcu-autoloader');
|
||||
$apcu = strpos($input, '--apcu-autoloader') !== false || $config->get('apcu-autoloader');
|
||||
|
||||
$updateAllowTransitiveDependencies = Request::UPDATE_ONLY_LISTED;
|
||||
if ($input->getOption('with-all-dependencies')) {
|
||||
|
@ -210,7 +210,7 @@ EOT
|
|||
->setRunScripts(!$input->getOption('no-scripts'))
|
||||
->setOptimizeAutoloader($optimize)
|
||||
->setClassMapAuthoritative($authoritative)
|
||||
->setApcuAutoloader($apcu)
|
||||
->setApcuAutoloader($apcu ? $input->getOption('apcu-autoloader') ?: true : false)
|
||||
->setUpdate(true)
|
||||
->setInstall(!$input->getOption('no-install'))
|
||||
->setUpdateMirrors($updateMirrors)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue