UserFrosting API

CreateAdminUser extends BaseCommand Uses DatabaseTest

Create root user CLI command.

Tags
author

Alex Weissman (https://alexanderweissman.com)

Table of Contents

$dependencies string[]
$io SymfonyStyle
$ci ContainerInterface
configure() {@inheritdoc} mixed
execute() {@inheritdoc} mixed
askUsername() Ask for the username and return a valid one. string
validateUsername() Validate the username. bool
askEmail() Ask for the email and return a valid one. string
validateEmail() Validate the email. bool
askFirstName() Ask for the first name and return a valid one. string
validateFirstName() Validate the first name. bool
askLastName() Ask for the last name and return a valid one. string
validateLastName() Validate the last name entered is valid. bool
askPassword() Ask for the password and return a valid one. string
validatePassword() Validate password input. bool
confirmPassword() Ask for password confirmation. bool
validatePasswordConfirmation() Validate the confirmation password. bool
testDB() Function to test the db connexion. bool
initialize() {@inheritdoc} mixed
setContainer() Setup the global container object. void
isProduction() Return if the app is in production mode. bool

Properties

$dependencies

protected string[] $dependencies = ['\\UserFrosting\\Sprinkle\\Account\\Database\\Migrations\\v400\\UsersTable', '\\UserFrosting\\Sprinkle\\Account\\Database\\Migrations\\v400\\RolesTable', '\\UserFrosting\\Sprinkle\\Account\\Database\\Migrations\\v400\\RoleUsersTable']

Methods

configure()

{@inheritdoc}

protected configure( ) : mixed
Return values
mixed

execute()

{@inheritdoc}

protected execute( $input : InputInterface , $output : OutputInterface ) : mixed
Parameters
$input : InputInterface
$output : OutputInterface
Return values
mixed

askUsername()

Ask for the username and return a valid one.

protected askUsername( [ $username : string = '' ] ) : string
Parameters
$username : string = ''

The base/default username

Return values
string

The validated username

validateUsername()

Validate the username.

protected validateUsername( $username : string ) : bool
Parameters
$username : string

The input

Return values
bool

Is the username validated ?

askEmail()

Ask for the email and return a valid one.

protected askEmail( [ $email : string = '' ] ) : string
Parameters
$email : string = ''

The base/default email

Return values
string

The validated email

validateEmail()

Validate the email.

protected validateEmail( $email : string ) : bool
Parameters
$email : string

The input

Return values
bool

Is the email validated ?

askFirstName()

Ask for the first name and return a valid one.

protected askFirstName( [ $firstName : string = '' ] ) : string
Parameters
$firstName : string = ''

The base/default first name

Return values
string

The validated first name

validateFirstName()

Validate the first name.

protected validateFirstName( $firstName : string ) : bool
Parameters
$firstName : string

The input

Return values
bool

Is the input validated ?

askLastName()

Ask for the last name and return a valid one.

protected askLastName( [ $lastName : string = '' ] ) : string
Parameters
$lastName : string = ''

The base/default last name

Return values
string

The validated last name

validateLastName()

Validate the last name entered is valid.

protected validateLastName( $lastName : string ) : bool
Parameters
$lastName : string

The lastname

Return values
bool

Input is valid or not

askPassword()

Ask for the password and return a valid one.

protected askPassword( [ $password : string = '' ] [, $requireConfirmation : bool = true ] ) : string
Parameters
$password : string = ''

The base/default password

$requireConfirmation : bool = true

(default true)

Return values
string

The validated password

validatePassword()

Validate password input.

protected validatePassword( $password : string ) : bool
Parameters
$password : string

The input

Return values
bool

Is the password valid or not

confirmPassword()

Ask for password confirmation.

protected confirmPassword( $passwordToConfirm : string [, $requireConfirmation : bool = true ] ) : bool
Parameters
$passwordToConfirm : string
$requireConfirmation : bool = true

(default true)

Return values
bool

Is the password confirmed or not

validatePasswordConfirmation()

Validate the confirmation password.

protected validatePasswordConfirmation( $password : string , $passwordToConfirm : string ) : bool
Parameters
$password : string

The confirmation

$passwordToConfirm : string

The password to confirm

Return values
bool

Is the confirmation password valid or not

testDB()

Function to test the db connexion.

protected testDB( ) : bool
Return values
bool

True if success

initialize()

{@inheritdoc}

protected initialize( $input : InputInterface , $output : OutputInterface ) : mixed
Parameters
$input : InputInterface
$output : OutputInterface
Return values
mixed

setContainer()

Setup the global container object.

public setContainer( $ci : ContainerInterface ) : void
Parameters
$ci : ContainerInterface

isProduction()

Return if the app is in production mode.

protected isProduction( ) : bool

@return bool True/False if the app is in production mode

Return values
bool

Search results