SetupSmtpCommand extends BaseCommand
SMTP Setup Wizard CLI Tools.
Helper command to setup SMTP config in .env file.
Tags
Table of Contents
Setup_SMTP | 'SMTP Server' | |
---|---|---|
Setup_Gmail | 'Gmail' | |
Setup_None | 'No email support' | |
$envPath | string | |
$io | SymfonyStyle | |
$ci | ContainerInterface | |
configure() | {@inheritdoc} | mixed |
execute() | {@inheritdoc} | mixed |
askForSmtpMethod() | Ask with setup method to use. | array |
askForSmtp() | Ask for SMTP credential. | array |
askForGmail() | Ask for Gmail. | array |
askForNone() | Process the "no email support" setup option. | array |
isSmtpConfigured() | Check if the app/.env SMTP portion is defined or not. | bool |
initialize() | {@inheritdoc} | mixed |
setContainer() | Setup the global container object. | void |
isProduction() | Return if the app is in production mode. | bool |
Constants
Setup_SMTP
public
string
$Setup_SMTP
= 'SMTP Server'
Setup_Gmail
public
string
$Setup_Gmail
= 'Gmail'
Setup_None
public
string
$Setup_None
= 'No email support'
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
mixedaskForSmtpMethod()
Ask with setup method to use.
protected
askForSmtpMethod(
$input :
InputInterface
)
: array
Parameters
- $input : InputInterface
Return values
array —The SMTP connection info
askForSmtp()
Ask for SMTP credential.
protected
askForSmtp(
$input :
InputInterface
)
: array
Parameters
- $input : InputInterface
Command arguments
Return values
array —The SMTP connection info
askForGmail()
Ask for Gmail.
protected
askForGmail(
$input :
InputInterface
)
: array
Parameters
- $input : InputInterface
Command arguments
Return values
array —The SMTP connection info
askForNone()
Process the "no email support" setup option.
protected
askForNone(
$input :
InputInterface
)
: array
Parameters
- $input : InputInterface
Return values
array —The SMTP connection info
isSmtpConfigured()
Check if the app/.env SMTP portion is defined or not.
protected
isSmtpConfigured(
$dotenvEditor :
DotenvEditor
)
: bool
Parameters
- $dotenvEditor : DotenvEditor
Return values
bool —true if SMTP is configured in .env file
initialize()
{@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