Magento 2 has a console command admin:user:create
At a quick search we find a class that defines a command with such a name Magento\Setup\Console\Command\AdminUserCreateCommand
Yet putting a breakpoint
or even the old var_dump die
seems to have no effect when this console command is run admin:user:create
.
So what code is executed when we run admin:user:create
from the console?
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
var_dump("here");
exit;
$errors = $this->validate($input);
if ($errors) {
$output->writeln('<error>' . implode('</error>' . PHP_EOL . '<error>', $errors) . '</error>');
// we must have an exit code higher than zero to indicate something was wrong
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
}
$installer = $this->installerFactory->create(new ConsoleLogger($output));
$installer->installAdminUser($input->getOptions());
$output->writeln(
'<info>Created Magento administrator user named ' . $input->getOption(AdminAccount::KEY_USER) . '</info>'
);
}
Does nothing. The command executes freely.