Fix init performance when plugin commands are not needed, fixes #10064
parent
5f48f87501
commit
9727adf63b
|
@ -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())) {
|
||||||
|
|
Loading…
Reference in New Issue