SetupDbCommand extends BaseCommand
DB Setup Wizard CLI Tools.
Helper command to setup database config in .env file.
Tags
Table of Contents
$envPath | string | |
---|---|---|
$io | SymfonyStyle | |
$ci | ContainerInterface | |
configure() | {@inheritdoc} | mixed |
execute() | {@inheritdoc} | mixed |
askForDatabase() | Ask for database crendentials. | array |
testDatabase() | Test new database connecion. | bool |
databaseDrivers() | Return the database choices for the env setup. | Collection |
getDatabaseDriversList() | Returns a list of available drivers. | array |
initialize() | {@inheritdoc} | mixed |
setContainer() | Setup the global container object. | void |
isProduction() | Return if the app is in production mode. | bool |
Properties
$envPath
protected
string
$envPath
= \UserFrosting\APP_DIR . '/.env'
$io
protected
SymfonyStyle
$io
Tags
$ci
protected
ContainerInterface
$ci
Methods
configure()
{@inheritdoc}
protected
configure(
)
: mixed
Return values
mixedexecute()
{@inheritdoc}
protected
execute(
$input :
InputInterface
, $output :
OutputInterface
)
: mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
mixedaskForDatabase()
Ask for database crendentials.
protected
askForDatabase(
$args :
InputInterface
)
: array
Parameters
- $args : InputInterface
Command arguments
Return values
array —The databse credentials
testDatabase()
Test new database connecion.
protected
testDatabase(
$dbParams :
array
[, $displayMessage :
bool
= true ]
)
: bool
Parameters
- $dbParams : array
Database params
- $displayMessage : bool = true
Display io message
Return values
bool —Return true if db is successful
databaseDrivers()
Return the database choices for the env setup.
protected
databaseDrivers(
)
: Collection
Return values
CollectiongetDatabaseDriversList()
Returns a list of available drivers.
protected
getDatabaseDriversList(
)
: array
Return values
arrayinitialize()
{@inheritdoc}
protected
initialize(
$input :
InputInterface
, $output :
OutputInterface
)
: mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
mixedsetContainer()
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