I am trying to run a command from a controller but it does not work. This is my code:
$email = $request->get('email');
if (empty($email))
$email = $request->get('nombres');
if (empty($password))
$password = '123456';
$application = new Application($this->container->get('kernel'));
$application->setAutoExit(false);
$input = new ArrayInput(array(
"command" => "fos:user:create",
"username" => $username,
"email" => $email,
"password" => $password));
$output = new ConsoleOutput();
$retval = $application->run($input, $output);
var_dump(stream_get_contents($output->getStream()));
die();
Simply it does nothing, #retval is 1 and the $output var is empty.
Any help will be appreciated Thanks
Jaime