PHP Class REBELinBLUE\Deployer\Console\Commands\InstallApp

TODO: Refactor the validator to reduce duplication TODO: Move the writing the env file to another class.
Inheritance: extends Illuminate\Console\Command, use trait REBELinBLUE\Deployer\Console\Commands\Traits\AskAndValidate
Mostra file Open project: rebelinblue/deployer Class Usage Examples

Protected Properties

Property Type Description
$description string The console command description.
$signature string The name and signature of the console command.

Public Methods

Method Description
__construct ( REBELinBLUE\Deployer\Contracts\Repositories\UserRepositoryInterface $repository = null ) InstallApp constructor.
handle ( ) : mixed Execute the console command.

Protected Methods

Method Description
block ( string | array $messages, string $type = 'error' ) A wrapper around symfony's formatter helper to output a block.
checkRequirements ( ) : boolean Checks the system meets all the requirements needed to run Deployer.
clearCaches ( ) Clears all Laravel caches.
generateJWTKey ( ) : string Generates a key for JWT.
header ( string $header ) Outputs a header block.
migrate ( boolean $seed = false ) Calls the artisan migrate to set up the database in development mode it also seeds the DB.
optimize ( ) Runs the artisan optimize commands.
writeEnvFile ( array $input ) : boolean Writes the configuration data to the config file.

Private Methods

Method Description
generateKey ( ) Calls the artisan key:generate to set the APP_KEY.
getAdminInformation ( ) : array Prompts for the admin user details.
getDatabaseDrivers ( ) : array Gets an array of available PDO drivers which are supported by Laravel.
getDatabaseInformation ( ) : array Prompts the user for the database connection details.
getEmailInformation ( ) : array Prompts the user for the details for the email setup.
getInstallInformation ( ) : array Prompts the user for the basic setup information.
getLocales ( ) : array Gets a list of the available locales.
getTimezoneLocations ( integer $region ) : array Gets a list of available locations in the supplied region.
getTimezoneRegions ( ) : array Gets a list of timezone regions.
verifyDatabaseDetails ( array $database ) : boolean Verifies that the database connection details are correct.
verifyNotInstalled ( ) : boolean Ensures that Deployer has not been installed yet.

Method Details

__construct() public method

InstallApp constructor.
public __construct ( REBELinBLUE\Deployer\Contracts\Repositories\UserRepositoryInterface $repository = null )
$repository REBELinBLUE\Deployer\Contracts\Repositories\UserRepositoryInterface

block() protected method

A wrapper around symfony's formatter helper to output a block.
protected block ( string | array $messages, string $type = 'error' )
$messages string | array Messages to output
$type string The type of message to output

checkRequirements() protected method

Checks the system meets all the requirements needed to run Deployer.
protected checkRequirements ( ) : boolean
return boolean

clearCaches() protected method

Clears all Laravel caches.
protected clearCaches ( )

generateJWTKey() protected method

Generates a key for JWT.
protected generateJWTKey ( ) : string
return string

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed

header() protected method

Outputs a header block.
protected header ( string $header )
$header string The text to output

migrate() protected method

Calls the artisan migrate to set up the database in development mode it also seeds the DB.
protected migrate ( boolean $seed = false )
$seed boolean Whether or not to seed the database

optimize() protected method

Runs the artisan optimize commands.
protected optimize ( )

writeEnvFile() protected method

Writes the configuration data to the config file.
protected writeEnvFile ( array $input ) : boolean
$input array The config data to write
return boolean

Property Details

$description protected_oe property

The console command description.
protected string $description
return string

$signature protected_oe property

The name and signature of the console command.
protected string $signature
return string