ScheduleRunCommand
class ScheduleRunCommand extends Command
Traits
Properties
| protected Factory|null | $components | The console components factory. |
from InteractsWithIO |
| protected InputInterface|null | $input | from InteractsWithIO | |
| protected OutputStyle|null | $output | from InteractsWithIO | |
| protected int | $verbosity | The default verbosity of output commands. |
from InteractsWithIO |
| protected array | $verbosityMap | The mapping between human readable verbosity levels and Symfony's OutputInterface. |
from InteractsWithIO |
| protected SignalRegistry|null | $signalRegistry | from InteractsWithSignals | |
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected string|null | $signature | The console command signature. |
|
| protected string|null | $name | The console command name. |
from Command |
| protected string | $description | The console command description. |
|
| protected string | $help | The console command help text. |
from Command |
| $hidden | Indicates whether the command should be shown in the Artisan command list. |
from Command | |
| protected bool | $isolated | Indicates whether only one instance of the command can run at any given time. |
from Command |
| protected int | $isolatedExitCode | The default exit code for isolated commands. |
from Command |
| protected string[] | $aliases | The console command name aliases. |
from Command |
| protected bool | $coroutine | Whether to execute in a coroutine environment. |
from Command |
| protected Dispatcher|null | $eventDispatcher | The event dispatcher instance. |
from Command |
| protected int | $hookFlags | The hook flags for the coroutine. |
from Command |
| protected int | $exitCode | The exit code of the command. |
from Command |
| protected Application|null | $hypervel | The Hypervel application instance. |
from Command |
| protected Schedule | $schedule | The schedule instance. |
|
| protected Dispatcher | $dispatcher | The event dispatcher. |
|
| protected Repository | $cache | The cache repository implementation. |
|
| protected ExceptionHandler | $handler | The exception handler. |
|
| protected CarbonInterface|null | $startedAt | The timestamp this scheduler command started running. |
|
| protected bool | $eventsRan | Check if any events ran. |
|
| protected bool | $shouldStop | Check if scheduler should stop. |
|
| protected CarbonInterface|null | $lastChecked | Last time the stopped state was checked. |
|
| protected bool | $paused | Check if the scheduler is paused. |
|
| protected CarbonInterface|null | $pausedLastChecked | Last time the paused state was checked. |
|
| protected Concurrent|null | $concurrent | The concurrent instance. |
|
| protected string|null | $evaluatedEventsMinute | The minute currently represented by the evaluated event cache. |
|
| protected array<int, true> | $evaluatedEvents | The non-repeatable events already evaluated for the current minute. |
|
| protected Event, count: int<1, max>}> | $runningEvents | The events currently running in this process. |
Methods
Resolve the console command instance for the given command.
Call another console command.
Call another console command without output.
Call another console command without output.
Run the given console command.
Create an input instance from the given arguments.
Prompt the user until the given validation callback passes.
Validate the given prompt value using the validator.
Get the validator instance that should be used to validate prompts.
Get the validation messages that should be used during prompt validation.
Get the validation attributes that should be used during prompt validation.
Add the disable event dispatcher option to the command.
Disable or enable the event dispatcher based on the input option.
Retrieve the command's input as a CommandInput instance or retrieve an input item.
Confirm a question with the user.
Prompt the user for input.
Prompt the user for input with auto completion.
Prompt the user for input with auto completion.
Prompt the user for input but hide the answer from the console.
Give the user a single choice from an array of answers.
Format input to textual table.
Execute a given callback while advancing a progress bar.
Write a string as information output.
Write a string as standard output.
Write a string as comment output.
Write a string as question output.
Write a string as error output.
Write a string as warning output.
Write a string in an alert box.
Get the output component factory implementation.
Get the verbosity level in terms of Symfony's OutputInterface level.
Define a callback to be run when the given signal(s) occurs.
Unregister signal handlers for one, many, or all signals.
Interact with the user before validating the input.
Prompt the user for any missing arguments.
Prompt for missing input arguments using the returned questions.
Perform actions after the user was prompted for missing arguments.
Determine whether the input contains any options that differ from the default values.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Configure usage examples for the command from class attributes.
Configure the console command using a fluent definition.
Get a command isolation mutex instance for the command.
Set up the traits used by the command.
Execute the console command.
No description
Run the scheduled events once.
Run the given repeating events for the remainder of the current minute.
Determine if the non-repeatable event was already evaluated this minute.
Determine if the schedule is paused.
Determine if the schedule run should be interrupted.
Clear the interrupt cache.
Listen for signals that should release owned event mutexes.
Release mutexes for events that are currently running.
Dispatch the scheduled task skipped event when listeners are registered.
Details
in
CallsCommands at line 18
abstract protected Command
resolveCommand(Command|string $command)
Resolve the console command instance for the given command.
in
CallsCommands at line 23
int
call(Command|string $command, array $arguments = [])
Call another console command.
in
CallsCommands at line 31
int
callSilent(Command|string $command, array $arguments = [])
Call another console command without output.
in
CallsCommands at line 39
int
callSilently(Command|string $command, array $arguments = [])
Call another console command without output.
in
CallsCommands at line 47
protected int
runCommand(Command|string $command, array $arguments, OutputInterface $output)
Run the given console command.
in
CallsCommands at line 64
protected ArrayInput
createInputFromArguments(array $arguments)
Create an input instance from the given arguments.
in
CallsCommands at line 78
protected array
context()
Get all the context passed to the command.
in
ConfiguresPrompts at line 32
protected void
configurePrompts(InputInterface $input)
Configure the prompt fallbacks.
in
ConfiguresPrompts at line 149
protected PResult
promptUntilValid(PResult $prompt, bool|string $required, null|PResult): mixed $validate)
Prompt the user until the given validation callback passes.
in
ConfiguresPrompts at line 185
protected ?string
validatePrompt(mixed $value, mixed $rules)
Validate the given prompt value using the validator.
in
ConfiguresPrompts at line 220
protected Validator
getPromptValidatorInstance(mixed $field, mixed $value, mixed $rules, array $messages = [], array $attributes = [])
Get the validator instance that should be used to validate prompts.
in
ConfiguresPrompts at line 235
protected array
validationMessages()
Get the validation messages that should be used during prompt validation.
in
ConfiguresPrompts at line 245
protected array
validationAttributes()
Get the validation attributes that should be used during prompt validation.
in
DisableEventDispatcher at line 17
void
addDisableDispatcherOption()
Add the disable event dispatcher option to the command.
in
DisableEventDispatcher at line 25
void
disableDispatcher(InputInterface $input)
Disable or enable the event dispatcher based on the input option.
in
HasParameters at line 15
protected void
specifyParameters()
Specify the arguments and options on the command.
in
HasParameters at line 40
protected array
getArguments()
Get the console command arguments.
in
HasParameters at line 48
protected array
getOptions()
Get the console command options.
in
InteractsWithIO at line 53
mixed
input(string|null $key = null, mixed $default = null)
Retrieve the command's input as a CommandInput instance or retrieve an input item.
in
InteractsWithIO at line 63
bool
hasArgument(int|string $name)
Determine if the given argument is present.
in
InteractsWithIO at line 71
mixed
argument(string|null $key = null)
Get the value of a command argument.
in
InteractsWithIO at line 83
array
arguments()
Get all of the arguments passed to the command.
in
InteractsWithIO at line 91
bool
hasOption(string $name)
Determine if the given option is present.
in
InteractsWithIO at line 99
mixed
option(string|null $key = null)
Get the value of a command option.
in
InteractsWithIO at line 111
array
options()
Get all of the options passed to the command.
in
InteractsWithIO at line 119
bool
confirm(string $question, bool $default = false)
Confirm a question with the user.
in
InteractsWithIO at line 127
mixed
ask(string $question, string|null $default = null)
Prompt the user for input.
in
InteractsWithIO at line 135
mixed
anticipate(string $question, iterable|callable $choices, string|null $default = null)
Prompt the user for input with auto completion.
in
InteractsWithIO at line 143
mixed
askWithCompletion(string $question, iterable|callable $choices, string|null $default = null)
Prompt the user for input with auto completion.
in
InteractsWithIO at line 157
mixed
secret(string $question, bool $fallback = true)
Prompt the user for input but hide the answer from the console.
in
InteractsWithIO at line 169
array|string
choice(string $question, array $choices, int|string|null $default = null, int|null $attempts = null, bool $multiple = false)
Give the user a single choice from an array of answers.
in
InteractsWithIO at line 181
void
table(array $headers, array|Arrayable $rows, string|TableStyle $tableStyle = 'default', array $columnStyles = [])
Format input to textual table.
in
InteractsWithIO at line 201
mixed
withProgressBar(iterable|int $totalSteps, Closure $callback)
Execute a given callback while advancing a progress bar.
in
InteractsWithIO at line 231
void
info(string $string, int|string|null $verbosity = null)
Write a string as information output.
in
InteractsWithIO at line 239
void
line(string $string, string|null $style = null, int|string|null $verbosity = null)
Write a string as standard output.
in
InteractsWithIO at line 249
void
comment(string $string, int|string|null $verbosity = null)
Write a string as comment output.
in
InteractsWithIO at line 257
void
question(string $string, int|string|null $verbosity = null)
Write a string as question output.
in
InteractsWithIO at line 265
void
error(string $string, int|string|null $verbosity = null)
Write a string as error output.
in
InteractsWithIO at line 273
void
warn(string $string, int|string|null $verbosity = null)
Write a string as warning output.
in
InteractsWithIO at line 287
void
alert(string $string, int|string|null $verbosity = null)
Write a string in an alert box.
in
InteractsWithIO at line 301
InteractsWithIO
newLine(int $count = 1)
Write a blank line.
in
InteractsWithIO at line 311
void
setInput(InputInterface $input)
Set the input interface implementation.
in
InteractsWithIO at line 319
void
setOutput(OutputStyle $output)
Set the output interface implementation.
in
InteractsWithIO at line 327
OutputStyle|null
getOutput()
Get the output implementation.
in
InteractsWithIO at line 335
Factory|null
outputComponents()
Get the output component factory implementation.
in
InteractsWithIO at line 343
protected void
setVerbosity(int|string $level)
Set the verbosity level.
in
InteractsWithIO at line 351
protected int
parseVerbosity(int|string|null $level = null)
Get the verbosity level in terms of Symfony's OutputInterface level.
in
InteractsWithSignals at line 20
void
trap(array|int $signo, callable $callback)
Define a callback to be run when the given signal(s) occurs.
in
InteractsWithSignals at line 35
void
untrap(array|int|null $signo = null)
Unregister signal handlers for one, many, or all signals.
in
PromptsForMissingInput at line 22
protected void
interact(InputInterface $input, OutputInterface $output)
Interact with the user before validating the input.
in
PromptsForMissingInput at line 34
protected void
promptForMissingArguments(InputInterface $input, OutputInterface $output)
Prompt the user for any missing arguments.
in
PromptsForMissingInput at line 74
protected array
promptForMissingArgumentsUsing()
Prompt for missing input arguments using the returned questions.
in
PromptsForMissingInput at line 82
protected void
afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
Perform actions after the user was prompted for missing arguments.
in
PromptsForMissingInput at line 89
protected bool
didReceiveOptions(InputInterface $input)
Determine whether the input contains any options that differ from the default values.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
in
Command at line 112
__construct(string|null $name = null)
No description
in
Command at line 164
int
run(InputInterface $input, OutputInterface $output)
Run the console command.
in
Command at line 187
protected void
configureIsolation()
Configure the console command for isolation.
in
Command at line 201
protected void
configureFromAttributes()
Configure the command from class attributes.
in
Command at line 243
protected void
configureUsageFromAttribute()
Configure usage examples for the command from class attributes.
in
Command at line 255
protected void
configureUsingFluentDefinition()
Configure the console command using a fluent definition.
in
Command at line 268
protected void
configure()
No description
in
Command at line 273
protected int
execute(InputInterface $input, OutputInterface $output)
No description
in
Command at line 366
protected CommandMutex
commandIsolationMutex()
Get a command isolation mutex instance for the command.
in
Command at line 373
protected void
replaceOutput()
No description
in
Command at line 385
void
fail(string|Throwable|null $exception = null)
Fail the command manually.
in
Command at line 427
bool
isHidden()
Determine if the command is hidden.
in
Command at line 447
Application
getHypervel()
Get the Hypervel application instance.
in
Command at line 459
void
setHypervel(Application $hypervel)
Set the Hypervel application instance.
in
Command at line 467
protected array
setUpTraits(InputInterface $input, OutputInterface $output)
Set up the traits used by the command.
in
Command at line 483
static void
flushState()
Flush all static state.
at line 125
handle(Schedule $schedule, Dispatcher $dispatcher, Repository $cache, ExceptionHandler $handler)
Execute the console command.
at line 175
protected void
stop()
No description
at line 192
protected void
runOnce()
Run the scheduled events once.
at line 220
protected void
repeatEvents(Collection $events)
Run the given repeating events for the remainder of the current minute.
at line 272
protected void
runEvents(Collection $events, CarbonInterface $startedAt)
No description
at line 319
protected bool
hasAlreadyEvaluatedNonRepeatableEvent(Event $event, CarbonInterface $startedAt)
Determine if the non-repeatable event was already evaluated this minute.
at line 346
protected void
runSingleServerEvent(Event $event, CarbonInterface $startedAt)
Run the given single server event.
at line 361
protected void
runEvent(Event $event)
Run the given event.
at line 448
protected bool
isPaused()
Determine if the schedule is paused.
at line 466
protected bool
shouldStop()
Determine if the schedule run should be interrupted.
at line 488
protected void
clearShouldStop()
Clear the interrupt cache.
at line 498
protected void
listenForSignals()
Listen for signals that should release owned event mutexes.
at line 506
protected void
registerRunningEvent(Event $event)
Register a running event for signal cleanup.
at line 522
protected void
forgetRunningEvent(Event $event)
Forget a running event after it finishes.
at line 542
protected void
releaseRunningEventMutexes()
Release mutexes for events that are currently running.
at line 552
protected void
dispatchTaskSkipped(Event $event)
Dispatch the scheduled task skipped event when listeners are registered.