1
0
Fork 0

Fixes plugin commands not being loaded during completion

Closes #11074

Co-authored-by: Susanne Moog <look@susi.dev>
pull/11113/head
Jordi Boggiano 2022-10-12 11:03:52 +02:00
parent 69d316d1e6
commit b2ebe841e4
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 0 deletions

View File

@ -235,6 +235,9 @@ class Application extends BaseApplication
false === $commandName false === $commandName
// list command requires plugin commands to show them // list command requires plugin commands to show them
|| in_array($commandName, ['', 'list', 'help'], true) || in_array($commandName, ['', 'list', 'help'], true)
// autocompletion requires plugin commands but if we are running as root without COMPOSER_ALLOW_SUPERUSER
// we'd rather not autocomplete plugins than abort autocompletion entirely, so we avoid loading plugins in this case
|| ($commandName === '_complete' && !$isNonAllowedRoot)
); );
if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands) { if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands) {