1
0
Fork 0

Fix init performance when plugin commands are not needed, fixes #10064

pull/10071/head
Jordi Boggiano 2021-08-19 14:37:43 +02:00
parent 5f48f87501
commit 9727adf63b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ class Application extends BaseApplication
} }
} }
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 { try {
foreach ($this->getPluginCommands() as $command) { foreach ($this->getPluginCommands() as $command) {
if ($this->has($command->getName())) { if ($this->has($command->getName())) {