@ -55,6 +55,8 @@ class Application extends BaseApplication
/_/
/_/
';
';
private $hasPluginCommands = false;
public function __construct()
public function __construct()
{
{
static $shutdownRegistered = false;
static $shutdownRegistered = false;
@ -107,17 +109,29 @@ class Application extends BaseApplication
$io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
$io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
ErrorHandler::register($io);
ErrorHandler::register($io);
// determine command name to be executed
if (!$input->hasParameterOption('--no-plugins') && !$this->hasPluginCommands) {
foreach ($this->getPluginCommands() as $command) {
if ($this->has($command->getName())) {
$io->writeError('<warning>Plugin command '.$command->getName().' ('.get_class($command).') would override a Composer command and has been skipped</warning>');
} else {
$this->add($command);
}
}
$this->hasPluginCommands = true;
}
// determine command name to be executed, and if it's a proxy command
@ -196,16 +210,6 @@ class Application extends BaseApplication
$this->io->enableDebugging($startTime);
$this->io->enableDebugging($startTime);
}
}
if (!$input->hasParameterOption('--no-plugins') && !$isProxyCommand) {
foreach ($this->getPluginCommands() as $command) {
if ($this->has($command->getName())) {
$io->writeError('<warning>Plugin command '.$command->getName().' ('.get_class($command).') would override a Composer command and has been skipped</warning>');