PHP Класс CraftCli\Command\Command

Наследование: extends Symfony\Component\Console\Command\Command, implements CraftCli\Command\NeedsCraftInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$appPath string Craft app path
$basePath string Craft base path
$configPath string Craft config path
$craft Craft\ConsoleApp Craft app instance
$description string The console command description.
$input Symfony\Component\Console\Input\InputInterface The input interface implementation.
$name string The console command name.
$output Symfony\Component\Console\Style\StyleInterface The output interface implementation.
$pluginsPath string Craft plugins path
$showsDuration boolean Whether to show the command's duration after the command finishes
$storagePath string Craft storage path
$templatesPath string Craft templates path
$translationsPath string Craft translations path

Открытые методы

Метод Описание
anticipate ( string $question, array $choices, string $default = null ) : string Prompt the user for input with auto completion.
argument ( string $key = null ) : string | array Get the value of a command argument.
ask ( string $question, string $default = null ) : string Prompt the user for input.
askWithCompletion ( string $question, array $choices, string $default = null ) : string Prompt the user for input with auto completion.
choice ( string $question, array $choices, string $default = null, mixed $attempts = null, boolean $multiple = null ) : boolean Give the user a single choice from an array of answers.
comment ( string $string ) : void Write a string as comment output.
confirm ( string $question, boolean $default = false ) : boolean Confirm a question with the user.
error ( string $string ) : void Write a string as error output.
info ( string $string ) : void Write a string as information output.
line ( string $string ) : void Write a string as standard output.
option ( string $key = null ) : string | array Get the value of a command option.
question ( string $string ) : void Write a string as question output.
run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer Run the console command.
secret ( string $question, boolean $fallback = true ) : string Prompt the user for input but hide the answer from the console.
setAppPath ( $path )
setBasePath ( $path )
setConfigPath ( $path )
setCraft ( Craft\ConsoleApp $craft )
setEnvironment ( $environment )
setPluginsPath ( $path )
setStoragePath ( $path )
setTemplatesPath ( $path )
setTranslationsPath ( $path )
table ( array $headers, array $rows, string $style = 'default' ) : void Format input to textual table.
warn ( string $string ) : void Write a string as warning output.

Защищенные методы

Метод Описание
configure ( ) : void Specify the arguments and options on the command.
execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : mixed Execute the console command.
fire ( ) : mixed Execute the console command.
getArguments ( ) : array Get the console command arguments.
getOptions ( ) : array Get the console command options.
suppressOutput ( callable $callback ) : mixed Useful for supressing log messages

Описание методов

anticipate() публичный Метод

Prompt the user for input with auto completion.
public anticipate ( string $question, array $choices, string $default = null ) : string
$question string
$choices array
$default string
Результат string

argument() публичный Метод

Get the value of a command argument.
public argument ( string $key = null ) : string | array
$key string
Результат string | array

ask() публичный Метод

Prompt the user for input.
public ask ( string $question, string $default = null ) : string
$question string
$default string
Результат string

askWithCompletion() публичный Метод

Prompt the user for input with auto completion.
public askWithCompletion ( string $question, array $choices, string $default = null ) : string
$question string
$choices array
$default string
Результат string

choice() публичный Метод

Give the user a single choice from an array of answers.
public choice ( string $question, array $choices, string $default = null, mixed $attempts = null, boolean $multiple = null ) : boolean
$question string
$choices array
$default string
$attempts mixed
$multiple boolean
Результат boolean

comment() публичный Метод

Write a string as comment output.
public comment ( string $string ) : void
$string string
Результат void

configure() защищенный Метод

Specify the arguments and options on the command.
protected configure ( ) : void
Результат void

confirm() публичный Метод

Confirm a question with the user.
public confirm ( string $question, boolean $default = false ) : boolean
$question string
$default boolean
Результат boolean

error() публичный Метод

Write a string as error output.
public error ( string $string ) : void
$string string
Результат void

execute() защищенный Метод

Execute the console command.
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : mixed
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
Результат mixed

fire() защищенный Метод

Execute the console command.
protected fire ( ) : mixed
Результат mixed

getArguments() защищенный Метод

Get the console command arguments.
protected getArguments ( ) : array
Результат array

getOptions() защищенный Метод

Get the console command options.
protected getOptions ( ) : array
Результат array

info() публичный Метод

Write a string as information output.
public info ( string $string ) : void
$string string
Результат void

line() публичный Метод

Write a string as standard output.
public line ( string $string ) : void
$string string
Результат void

option() публичный Метод

Get the value of a command option.
public option ( string $key = null ) : string | array
$key string
Результат string | array

question() публичный Метод

Write a string as question output.
public question ( string $string ) : void
$string string
Результат void

run() публичный Метод

Run the console command.
public run ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
Результат integer

secret() публичный Метод

Prompt the user for input but hide the answer from the console.
public secret ( string $question, boolean $fallback = true ) : string
$question string
$fallback boolean
Результат string

setAppPath() публичный Метод

public setAppPath ( $path )

setBasePath() публичный Метод

public setBasePath ( $path )

setConfigPath() публичный Метод

public setConfigPath ( $path )

setCraft() публичный Метод

public setCraft ( Craft\ConsoleApp $craft )
$craft Craft\ConsoleApp

setEnvironment() публичный Метод

public setEnvironment ( $environment )

setPluginsPath() публичный Метод

public setPluginsPath ( $path )

setStoragePath() публичный Метод

public setStoragePath ( $path )

setTemplatesPath() публичный Метод

public setTemplatesPath ( $path )

setTranslationsPath() публичный Метод

public setTranslationsPath ( $path )

suppressOutput() защищенный Метод

Useful for supressing log messages
protected suppressOutput ( callable $callback ) : mixed
$callback callable
Результат mixed

table() публичный Метод

Format input to textual table.
public table ( array $headers, array $rows, string $style = 'default' ) : void
$headers array
$rows array
$style string
Результат void

warn() публичный Метод

Write a string as warning output.
public warn ( string $string ) : void
$string string
Результат void

Описание свойств

$appPath защищенное свойство

Craft app path
protected string $appPath
Результат string

$basePath защищенное свойство

Craft base path
protected string $basePath
Результат string

$configPath защищенное свойство

Craft config path
protected string $configPath
Результат string

$craft защищенное свойство

Craft app instance
protected ConsoleApp,Craft $craft
Результат Craft\ConsoleApp

$description защищенное свойство

The console command description.
protected string $description
Результат string

$input защищенное свойство

The input interface implementation.
protected InputInterface,Symfony\Component\Console\Input $input
Результат Symfony\Component\Console\Input\InputInterface

$name защищенное свойство

The console command name.
protected string $name
Результат string

$output защищенное свойство

The output interface implementation.
protected StyleInterface,Symfony\Component\Console\Style $output
Результат Symfony\Component\Console\Style\StyleInterface

$pluginsPath защищенное свойство

Craft plugins path
protected string $pluginsPath
Результат string

$showsDuration защищенное свойство

Whether to show the command's duration after the command finishes
protected bool $showsDuration
Результат boolean

$storagePath защищенное свойство

Craft storage path
protected string $storagePath
Результат string

$templatesPath защищенное свойство

Craft templates path
protected string $templatesPath
Результат string

$translationsPath защищенное свойство

Craft translations path
protected string $translationsPath
Результат string