ServeCommand
class ServeCommand extends Command (View source)
Трейты
| 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 | Имя и синтаксис консольной команды. | from Command |
| protected string | $name | Имя консольной команды. | |
| protected string | $description | Описание консольной команды. | |
| protected string|null | $help | Текст справки консольной команды. | from Command |
| $hidden | Указывает, должна ли команда отображаться в списке команд Artisan. | from Command | |
| protected int | $portOffset | Текущий смещение порта. |
Методы
| Command | resolveCommand(Command|string $command) Разрешить экземпляр консольной команды для данной команды. | from CallsCommands |
| int | call(Command|string $command, array $arguments = []) Вызвать другую консольную команду. | from CallsCommands |
| int | callSilent(Command|string $command, array $arguments = []) Вызвать другую консольную команду без вывода. | from CallsCommands |
| int | runCommand(Command|string $command, array $arguments, OutputInterface $output) Запустить заданную консольную команду. | from CallsCommands |
| ArrayInput | createInputFromArguments(array $arguments) Создать экземпляр ввода из заданных аргументов. | from CallsCommands |
| array | context() Получить весь контекст, переданный команде. | from CallsCommands |
| void | specifyParameters() Указать аргументы и опции команды. | from HasParameters |
| array | getArguments() Получить аргументы консольной команды. | from HasParameters |
| array | getOptions() Получить опции консольной команды. | |
| bool | hasArgument(string|int $name) Определить, присутствует ли данный аргумент. | from InteractsWithIO |
| string|array|null | argument(string|null $key = null) Получить значение аргумента команды. | from InteractsWithIO |
| array | arguments() Получить все аргументы, переданные команде. | from InteractsWithIO |
| bool | hasOption(string $name) Определить, присутствует ли данная опция. | from InteractsWithIO |
| string|array|bool|null | option(string|null $key = null) Получить значение опции команды. | from InteractsWithIO |
| array | options() Получить все опции, переданные команде. | from InteractsWithIO |
| bool | confirm(string $question, bool $default = false) Подтвердить вопрос у пользователя. | from InteractsWithIO |
| mixed | ask(string $question, string|null $default = null) Запросить ввод у пользователя. | from InteractsWithIO |
| mixed | anticipate(string $question, array|callable $choices, string|null $default = null) Запросить у пользователя ввод с автодополнением. | from InteractsWithIO |
| mixed | askWithCompletion(string $question, array|callable $choices, string|null $default = null) Запросить у пользователя ввод с автодополнением. | from InteractsWithIO |
| mixed | secret(string $question, bool $fallback = true) Запросить у пользователя ввод, но скрыть ответ в консоли. | from InteractsWithIO |
| string | choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool|null $multiple = null) Предложить пользователю один вариант из массива ответов. | from InteractsWithIO |
| void | table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = []) Форматировать ввод в текстовую таблицу. | from InteractsWithIO |
| void | info(string $string, int|string|null $verbosity = null) Вывести строку как информацию. | from InteractsWithIO |
| void | line(string $string, string|null $style = null, int|string|null $verbosity = null) Вывести строку в стандартный вывод. | from InteractsWithIO |
| void | comment(string $string, int|string|null $verbosity = null) Вывести строку как комментарий. | from InteractsWithIO |
| void | question(string $string, int|string|null $verbosity = null) Вывести строку как вопрос. | from InteractsWithIO |
| void | error(string $string, int|string|null $verbosity = null) Вывести строку как ошибку. | from InteractsWithIO |
| void | warn(string $string, int|string|null $verbosity = null) Вывести строку как предупреждение. | from InteractsWithIO |
| void | alert(string $string) Вывести строку в окне оповещения. | from InteractsWithIO |
| void | setInput(InputInterface $input)
Установить реализацию интерфейса ввода. | from InteractsWithIO |
| void | setOutput(OutputStyle $output)
Установить реализацию интерфейса вывода. | from InteractsWithIO |
| void | setVerbosity(string|int $level)
Установить уровень подробности. | from InteractsWithIO |
| int | parseVerbosity(string|int|null $level = null)
Получить уровень подробности в терминах уровня OutputInterface Symfony. | from InteractsWithIO |
| OutputStyle | getOutput()
Получить реализацию вывода. | from InteractsWithIO |
| static void | macro(string $name, object|callable $macro)
Зарегистрировать пользовательское макро. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Смешать другой объект в класс. | from Macroable |
| static bool | hasMacro(string $name)
Проверяет, зарегистрировано ли макро. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Динамически обработать вызовы к классу. | from Macroable |
| mixed | __call(string $method, array $parameters)
Динамически обработать вызовы к классу. | from Macroable |
| void | __construct()
Создать новый экземпляр команды консоли. | from Command |
| void | configureUsingFluentDefinition()
Настроить команду консоли с помощью определения fluent. | from Command |
| int | run(InputInterface $input, OutputInterface $output)
Запустить команду консоли. | from Command |
| mixed | execute(InputInterface $input, OutputInterface $output)
Выполнить команду консоли. | from Command |
| isHidden() {@inheritdoc} | from Command | |
| setHidden($hidden) {@inheritdoc} | from Command | |
| Application | getLaravel()
Получить экземпляр приложения Laravel. | from Command |
| void | setLaravel(Container $laravel)
Установить экземпляр приложения Laravel. | from Command |
| int | handle()
Выполнить команду консоли. | |
| string | serverCommand()
Получить полную команду сервера. | |
| string | host()
Получить хост для команды. | |
| string | port()
Получить порт для команды. | |
| bool | canTryAnotherPort()
Проверить, достигла ли команда максимального количества попыток порта. |
Details
abstract protected Command resolveCommand(Command|string $command)
Разрешить экземпляр команды консоли для заданной команды.
int call(Command|string $command, array $arguments = [])
Вызвать другую команду консоли.
int callSilent(Command|string $command, array $arguments = [])
Вызвать другую команду консоли без звука.
protected int runCommand(Command|string $command, array $arguments, OutputInterface $output)
Запустить заданную команду консоли.
protected ArrayInput createInputFromArguments(array $arguments)
Создать экземпляр ввода из заданных аргументов.
protected array context()
Получить весь контекст, переданный команде.
protected void specifyParameters()
Указать аргументы и параметры команды.
protected array getArguments()
Получить аргументы команды консоли.
protected array getOptions()
Получить параметры командной строки.
bool hasArgument(string|int $name)
Определить, присутствует ли указанный аргумент.
string|array|null argument(string|null $key = null)
Получить значение аргумента команды.
array arguments()
Получить все аргументы, переданные команде.
bool hasOption(string $name)
Определить, присутствует ли указанный параметр.
string|array|bool|null option(string|null $key = null)
Получить значение параметра команды.
array options()
Получить все параметры, переданные команде.
bool confirm(string $question, bool $default = false)
Подтвердить вопрос у пользователя.
mixed ask(string $question, string|null $default = null)
Запросить у пользователя ввод.
mixed anticipate(string $question, array|callable $choices, string|null $default = null)
Запросить у пользователя ввод с автозаполнением.
mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)
Запросить у пользователя ввод с автозаполнением.
mixed secret(string $question, bool $fallback = true)
Запросить у пользователя ввод, скрыв ответ в консоли.
string choice(string $question, array $choices, string|null $default = null, mixed|null $attempts = null, bool|null $multiple = null)
Предоставить пользователю единственный выбор из массива ответов.
void table(array $headers, Arrayable|array $rows, string $tableStyle = 'default', array $columnStyles = [])
Форматирование ввода в текстовую таблицу.
void info(string $string, int|string|null $verbosity = null)
Вывод строки как информационное сообщение.
void line(string $string, string|null $style = null, int|string|null $verbosity = null)
Вывод строки в стандартный вывод.
void comment(string $string, int|string|null $verbosity = null)
Вывод строки как комментарий.
void question(string $string, int|string|null $verbosity = null)
Вывод строки как вопрос.
void error(string $string, int|string|null $verbosity = null)
Вывод строки как сообщение об ошибке.
void warn(string $string, int|string|null $verbosity = null)
Вывод строки как предупреждение.
void alert(string $string)
Вывести строку в всплывающем окне.
void setInput(InputInterface $input)
Установить реализацию интерфейса ввода.
void setOutput(OutputStyle $output)
Установить реализацию интерфейса вывода.
protected void setVerbosity(string|int $level)
Установить уровень подробности.
protected int parseVerbosity(string|int|null $level = null)
Получить уровень подробности в терминах уровня OutputInterface Symfony.
OutputStyle getOutput()
Получить реализацию вывода.
static void macro(string $name, object|callable $macro)
Зарегистрировать пользовательское макро.
static void mixin(object $mixin, bool $replace = true)
Смешать другой объект в класс.
static bool hasMacro(string $name)
Проверяет, зарегистрировано ли макро.
static mixed __callStatic(string $method, array $parameters)
Динамически обрабатывать вызовы класса.
mixed __call(string $method, array $parameters)
Динамически обрабатывать вызовы класса.
void __construct()
Создать новый экземпляр команды консоли.
protected void configureUsingFluentDefinition()
Настроить команду консоли с помощью определения fluent.
int run(InputInterface $input, OutputInterface $output)
Выполнить команду консоли.
protected mixed execute(InputInterface $input, OutputInterface $output)
Выполнить команду консоли.
isHidden()
{@inheritdoc}
setHidden($hidden)
{@inheritdoc}
Application getLaravel()
Получить экземпляр приложения Laravel.
void setLaravel(Container $laravel)
Установить экземпляр приложения Laravel.
int handle()
Выполнить команду консоли.
protected string serverCommand()
Получить полную команду сервера.
protected string host()
Получить хост для команды.
protected string port()
Получить порт для команды.
protected bool canTryAnotherPort()
Проверка, достигнуто ли максимальное количество попыток подключения к порту.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/6.x/Illuminate/Foundation/Console/ServeCommand.html