Skip to content

Commit

Permalink
Fix init performance when plugin commands are not needed, fixes #10064
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Aug 19, 2021
1 parent 5f48f87 commit 9727adf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Composer/Console/Application.php
Expand Up @@ -186,7 +186,10 @@ public function doRun(InputInterface $input, OutputInterface $output)
}
}

if (!$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
// avoid loading plugins/initializing the Composer instance earlier than necessary if no plugin command is needed
$isComposerCommand = false !== $commandName;

if (!$isComposerCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
try {
foreach ($this->getPluginCommands() as $command) {
if ($this->has($command->getName())) {
Expand Down

0 comments on commit 9727adf

Please sign in to comment.