FOS\UserBundle\Command\CreateUserCommand::configure PHP Method

configure() protected method

See also: Command
protected configure ( )
    protected function configure()
    {
        $this->setName('fos:user:create')->setDescription('Create a user.')->setDefinition(array(new InputArgument('username', InputArgument::REQUIRED, 'The username'), new InputArgument('email', InputArgument::REQUIRED, 'The email'), new InputArgument('password', InputArgument::REQUIRED, 'The password'), new InputOption('super-admin', null, InputOption::VALUE_NONE, 'Set the user as super admin'), new InputOption('inactive', null, InputOption::VALUE_NONE, 'Set the user as inactive')))->setHelp(<<<EOT
The <info>fos:user:create</info> command creates a user:

  <info>php app/console fos:user:create matthieu</info>

This interactive shell will first ask you for a password.

You can alternatively specify the password as a second argument:

  <info>php app/console fos:user:create matthieu mypassword</info>

You can create a super admin via the super-admin flag:

  <info>php app/console fos:user:create admin --super-admin</info>

You can create an inactive user (will not be able to log in):

  <info>php app/console fos:user:create thibault --inactive</info>

EOT
);
    }

Usage Example

    protected function configure()
    {
        parent::configure();
        $definition = $this->getDefinition();
        $definition->addOption(new InputOption('user-system', null, InputOption::VALUE_REQUIRED, 'The user-system to use'));
        $this->setHelp(<<<EOT
The <info>fos:user:create</info> command creates a user:

  <info>php app/console fos:user:create --user-system=acme_user matthieu</info>

This interactive shell will ask you for an email and then a password.

You can alternatively specify the email and password as the second and third arguments:

  <info>php app/console fos:user:create --user-system=acme_user matthieu [email protected] mypassword</info>

You can create a super admin via the super-admin flag:

  <info>php app/console fos:user:create admin --super-admin</info>

You can create an inactive user (will not be able to log in):

  <info>php app/console fos:user:create thibault --inactive</info>

EOT
);
    }
All Usage Examples Of FOS\UserBundle\Command\CreateUserCommand::configure