Spec-Zone.ru › Laravel 8

KeyGenerateCommand

class KeyGenerateCommand extends Command (View source)

Свойства

ConfirmableTrait
CallsCommands
HasParameters
InteractsWithIO
Macroable

Свойства

protected InputInterface $input

Реализация интерфейса ввода.

from InteractsWithIO
protected OutputStyle $output

Реализация интерфейса вывода.

from InteractsWithIO
protected int $verbosity

Уровень детализации вывода по умолчанию для команд.

from InteractsWithIO
protected array $verbosityMap

Сопоставление удобочитаемых уровней детализации с уровнями Symfony OutputInterface.

from InteractsWithIO
static protected array $macros

Зарегистрированные строковые макросы.

from Macroable
protected Application $laravel

Экземпляр приложения Laravel.

from Command
protected string $signature

Имя и сигнатура консольной команды.

protected string $name

Имя консольной команды.

from Command
protected string $description

Описание консольной команды.

protected string $help

Текст справки консольной команды.

from Command
protected bool $hidden

Указывает, должна ли команда отображаться в списке команд Artisan.

from Command

Методы

Команда resolveCommand(Command|string $command)

Разрешить экземпляр консольной команды для заданной команды.

из CallsCommands
int call(Command|string $command, array $arguments = [])

Вызвать другую консольную команду.

из CallsCommands
int callSilent(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int callSilently(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Выполнить заданную консольную команду.

из CallsCommands
ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

из CallsCommands
массив context()

Получить весь контекст, переданный команде.

из CallsCommands
void specifyParameters()

Указать аргументы и параметры команды.

из HasParameters
массив getArguments()

Получить аргументы консольной команды.

из HasParameters
массив getOptions()

Получить параметры консольной команды.

из HasParameters
bool hasArgument(string|int $name)

Определить, присутствует ли заданный аргумент.

из InteractsWithIO
string|массив|null argument(string|null $key = null)

Получить значение аргумента команды.

из InteractsWithIO
массив arguments()

Получить все переданные команде аргументы.

из InteractsWithIO
bool hasOption(string $name)

Определить, присутствует ли заданный параметр.

из InteractsWithIO
string|массив|bool|null option(string|null $key = null)

Получить значение параметра команды.

из InteractsWithIO
массив options()

Получить все переданные команде параметры.

из InteractsWithIO
bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

из InteractsWithIO
mixed ask(string $question, string|null $default = null)

Запросить ввод у пользователя.

из InteractsWithIO
mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Запросить ввод у пользователя с автозавершением.

из InteractsWithIO
mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Запросить ввод у пользователя с автозавершением.

из InteractsWithIO
mixed secret(string $question, bool $fallback = true)

Запросить ввод у пользователя, но скрыть ответ в консоли.

из InteractsWithIO
string|массив choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предложить пользователю один выбор из массива ответов.

из InteractsWithIO
void table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])

Форматировать ввод в текстовую таблицу.

из InteractsWithIO
mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

Выполнить заданный обратный вызов, продвигая полосу прогресса.

из InteractsWithIO
void info(string $string, int|string|null $verbosity = null)

Вывести строку как информацию.

из InteractsWithIO
void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывести строку как стандартный вывод.

из InteractsWithIO
void comment(string $string, int|string|null $verbosity = null)

Вывести строку как комментарий.

из InteractsWithIO
void question(string $string, int|string|null $verbosity = null)

Вывести строку как вопрос.

из InteractsWithIO
void error(string $string, int|string|null $verbosity = null)

Вывести строку как ошибку.

из InteractsWithIO
void warn(string $string, int|string|null $verbosity = null)

Вывести строку как предупреждение.

из InteractsWithIO
void alert(string $string)

Вывести строку в всплывающем окне оповещения.

из InteractsWithIO
void newLine(int $count = 1)

Вывести пустую строку.

из InteractsWithIO
void setInput(InputInterface $input)

Установить реализацию интерфейса ввода.

из InteractsWithIO
void setOutput(OutputStyle $output)

Установить реализацию интерфейса вывода.

из InteractsWithIO
void setVerbosity(string|int $level)

Установить уровень подробности.

из InteractsWithIO
int parseVerbosity(string|int|null $level = null)

Получить уровень подробности в терминах уровня OutputInterface Symfony.

из InteractsWithIO
OutputStyle getOutput()

Получить реализацию вывода.

из InteractsWithIO
static void macro(string $name, object|callable $macro)

Зарегистрировать пользовательское макро.

из Macroable
static void mixin(object $mixin, bool $replace = true)

Смешать другой объект в класс.

из Macroable
static bool hasMacro(string $name)

Проверяет, зарегистрировано ли макро.

из Macroable
static void flushMacros()

Очистить существующие макросы.

из Macroable
static mixed __callStatic(string $method, array $parameters)

Динамически обрабатывать вызовы к классу.

из Macroable
mixed __call(string $method, array $parameters)

Динамически обрабатывать вызовы к классу.

из Macroable
void __construct()

Создать новый экземпляр команды консоли.

из Command
void configureUsingFluentDefinition()

Настроить команду консоли с помощью определения fluent.

из Command
int run(InputInterface $input, OutputInterface $output)

Запустить команду консоли.

из Command
int execute(InputInterface $input, OutputInterface $output)

Выполнить команду консоли.

из Command
bool isHidden()

{@inheritdoc}

из Command
Command setHidden(bool $hidden)

{@inheritdoc}

из Command
Application getLaravel()

Получить экземпляр приложения Laravel.

из Command
void setLaravel(Container $laravel)

Установить экземпляр приложения Laravel.

из Command
bool confirmToProceed(string $warning = 'Application In Production!', Closure|bool|null $callback = null)

Подтвердить перед продолжением действия.

из ConfirmableTrait
Closure getDefaultConfirmCallback()

Получить стандартный обратный вызов подтверждения.

из ConfirmableTrait
void handle()

Выполнить команду консоли.

string generateRandomKey()

Сгенерировать случайный ключ для приложения.

bool setKeyInEnvironmentFile(string $key)

Установить ключ приложения в файле среды.

void writeNewEnvironmentFileWith(string $key)

Записать новый файл среды с заданным ключом.

string keyReplacementPattern()

Получить шаблон регулярного выражения, который будет соответствовать env APP_KEY с любым случайным ключом.

Подробности

abstract protected Command resolveCommand(Command|string $command)

Разрешить экземпляр команды консоли для заданной команды.

Parameters

Command|string $command

Return Value

Command
END_OF_DOCUMENT_MARKER

int call(Command|string $command, array $arguments = [])

Вызвать другую команду консоли.

Parameters

Command|string $command
array $arguments

Return Value

int

int callSilent(Command|string $command, array $arguments = [])

Вызвать другую команду консоли без вывода.

Parameters

Command|string $command
array $arguments

Return Value

int

int callSilently(Command|string $command, array $arguments = [])

Вызвать другую команду консоли без вывода.

Parameters

Command|string $command
array $arguments

Return Value

int

protected int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Выполнить заданную команду консоли.

Parameters

Command|string $command
array $arguments
OutputInterface $output

Return Value

int

protected ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

Parameters

array $arguments

Return Value

ArrayInput

protected array context()

Получить весь контекст, переданный команде.

Return Value

array

protected void specifyParameters()

Указать аргументы и параметры команды.

Return Value

void

protected array getArguments()

Получить аргументы команды консоли.

Return Value

array

protected array getOptions()

Получить параметры команды консоли.

Return Value

array

bool hasArgument(string|int $name)

Определить, присутствует ли данный аргумент.

Parameters

string|int $name

Return Value

bool

string|array|null argument(string|null $key = null)

Получить значение аргумента команды.

Parameters

string|null $key

Return Value

string|array|null

array arguments()

Получить все аргументы, переданные команде.

Return Value

array

bool hasOption(string $name)

Определить, присутствует ли данный параметр.

Parameters

string $name

Return Value

bool

string|array|bool|null option(string|null $key = null)

Получить значение параметра команды.

Parameters

string|null $key

Return Value

string|array|bool|null

array options()

Получить все параметры, переданные команде.

Return Value

array

bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

Parameters

string $question
bool $default

Return Value

bool

mixed ask(string $question, string|null $default = null)

Запросить у пользователя ввод.

Parameters

string $question
string|null $default

Return Value

mixed

mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автодополнением.

Parameters

string $question
array|callable $choices
string|null $default

Return Value

mixed

mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автодополнением.

Parameters

string $question
array|callable $choices
string|null $default

Return Value

mixed

mixed secret(string $question, bool $fallback = true)

Запросить у пользователя ввод, скрывая ответ в консоли.

Parameters

string $question
bool $fallback

Return Value

mixed

string|array choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предложить пользователю выбор из массива ответов.

Parameters

string $question
array $choices
string|null $default
mixed|null $attempts
bool $multiple

Return Value

string|array

void table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])

Форматирование ввода в текстовую таблицу.

Параметры

array $headers
Arrayable|array $rows
string $tableStyle
array $columnStyles

Возвращаемое значение

void

mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

Выполнение заданного обратного вызова с отображением прогресс-бара.

Параметры

iterable|int $totalSteps
Closure $callback

Возвращаемое значение

mixed|void

void info(string $string, int|string|null $verbosity = null)

Вывод строки как информации.

Параметры

string $string
int|string|null $verbosity

Возвращаемое значение

void

void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывод строки в стандартный вывод.

Параметры

string $string
string|null $style
int|string|null $verbosity

Возвращаемое значение

void

void comment(string $string, int|string|null $verbosity = null)

Вывод строки как комментарий.

Параметры

string $string
int|string|null $verbosity

Возвращаемое значение

void

void question(string $string, int|string|null $verbosity = null)

Вывод строки как вопрос.

Параметры

string $string
int|string|null $verbosity

Возвращаемое значение

void

void error(string $string, int|string|null $verbosity = null)

Вывод строки как сообщение об ошибке.

Параметры

string $string
int|string|null $verbosity

Возвращаемое значение

void

void warn(string $string, int|string|null $verbosity = null)

Вывод строки как предупреждение.

Параметры

string $string
int|string|null $verbosity

Возвращаемое значение

void

void alert(string $string)

Вывод строки в диалоговом окне.

Параметры

string $string

Возвращаемое значение

void

void newLine(int $count = 1)

Вывод пустой строки.

Параметры

int $count

Возвращаемое значение

void

void setInput(InputInterface $input)

Установка реализации интерфейса ввода.

Параметры

InputInterface $input

Возвращаемое значение

void

void setOutput(OutputStyle $output)

Установка реализации интерфейса вывода.

Параметры

OutputStyle $output

Возвращаемое значение

void

protected void setVerbosity(string|int $level)

Установка уровня подробности.

Параметры

string|int $level

Возвращаемое значение

void

protected int parseVerbosity(string|int|null $level = null)

Получение уровня подробности в терминах уровня OutputInterface Symfony.

Параметры

string|int|null $level

Возвращаемое значение

int

OutputStyle getOutput()

Получение реализации вывода.

Возвращаемое значение

OutputStyle

static void macro(string $name, object|callable $macro)

Регистрация пользовательского макроса.

Параметры

string $name
object|callable $macro

Возвращаемое значение

void

static void mixin(object $mixin, bool $replace = true)

Добавление другого объекта в класс.

Параметры

object $mixin
bool $replace

Возвращаемое значение

void

Исключения

ReflectionException

static bool hasMacro(string $name)

Проверка наличия зарегистрированного макроса.

Параметры

string $name

Возвращаемое значение

bool

static void flushMacros()

Очистка существующих макросов.

Возвращаемое значение

void

static mixed __callStatic(string $method, array $parameters)

Динамическая обработка вызовов класса.

Параметры

string $method
array $parameters

Возвращаемое значение

mixed

Исключения

BadMethodCallException
END_OF_DOCUMENT_MARKER

mixed __call(string $method, array $parameters)

Динамически обрабатывает вызовы класса.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

void __construct()

Создаёт новый экземпляр команды консоли.

Return Value

void

protected void configureUsingFluentDefinition()

Настраивает команду консоли с помощью определения fluent.

Return Value

void

int run(InputInterface $input, OutputInterface $output)

Выполняет команду консоли.

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

protected int execute(InputInterface $input, OutputInterface $output)

Выполняет команду консоли.

Parameters

InputInterface $input
OutputInterface $output

Return Value

int

bool isHidden()

{@inheritdoc}

Return Value

bool

Command setHidden(bool $hidden)

{@inheritdoc}

Parameters

bool $hidden

Return Value

Command

Application getLaravel()

Получить экземпляр приложения Laravel.

Return Value

Application

void setLaravel(Container $laravel)

Установить экземпляр приложения Laravel.

Parameters

Container $laravel

Return Value

void

bool confirmToProceed(string $warning = 'Application In Production!', Closure|bool|null $callback = null)

Подтвердить перед выполнением действия.

Этот метод запрашивает подтверждение только в рабочей среде.

Parameters

string $warning
Closure|bool|null $callback

Return Value

bool

protected Closure getDefaultConfirmCallback()

Получить стандартный обратный вызов подтверждения.

Return Value

Closure

void handle()

Выполнить команду консоли.

Return Value

void

protected string generateRandomKey()

Сгенерировать случайный ключ для приложения.

Return Value

string

protected bool setKeyInEnvironmentFile(string $key)

Установить ключ приложения в файле среды.

Parameters

string $key

Return Value

bool

protected void writeNewEnvironmentFileWith(string $key)

Создать новый файл среды с заданным ключом.

Parameters

string $key

Return Value

void

protected string keyReplacementPattern()

Получить шаблон регулярного выражения, который будет соответствовать переменной среды APP_KEY с любым случайным ключом.

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Foundation/Console/KeyGenerateCommand.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API