SchedulerCommand extends Command
CLI command for the 'scheduler' extension which executes
Table of Contents
Properties
- $forceExecution : bool
- $io : SymfonyStyle
- $overwrittenTaskList : array<string|int, int>|null
- Array of tasks UIDs that should be executed. Null if task option is not provided.
- $scheduler : Scheduler
- $stopTasks : bool
- This is true when the tasks should be marked as stopped instead of being executed.
Methods
- __construct() : mixed
- configure() : mixed
- Configure the command by defining the name, options and arguments
- execute() : int
- Execute scheduler tasks
- executeOrStopTask() : void
- When in stop mode the given task is stopped. Otherwise the task is executed.
- fetchNextTask() : AbstractTask|null
- When the --task option is provided, the next task is fetched from the provided task UIDs. Depending on the --force option the task is fetched even if it is not marked for execution.
- getTask() : AbstractTask|null
- Return task a task for a given UID
- loopTasks() : bool
- Execute tasks in loop that are ready to execute
- shouldStopTasks() : bool
- Checks if the tasks should be stopped instead of being executed.
- stopTask() : mixed
- Stop task
Properties
$forceExecution
protected
bool
$forceExecution
$io
protected
SymfonyStyle
$io
$overwrittenTaskList
Array of tasks UIDs that should be executed. Null if task option is not provided.
protected
array<string|int, int>|null
$overwrittenTaskList
$scheduler
protected
Scheduler
$scheduler
$stopTasks
This is true when the tasks should be marked as stopped instead of being executed.
protected
bool
$stopTasks
= false
Methods
__construct()
public
__construct(Scheduler $scheduler) : mixed
Parameters
- $scheduler : Scheduler
configure()
Configure the command by defining the name, options and arguments
public
configure() : mixed
execute()
Execute scheduler tasks
public
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intexecuteOrStopTask()
When in stop mode the given task is stopped. Otherwise the task is executed.
protected
executeOrStopTask(AbstractTask $task) : void
Parameters
- $task : AbstractTask
fetchNextTask()
When the --task option is provided, the next task is fetched from the provided task UIDs. Depending on the --force option the task is fetched even if it is not marked for execution.
protected
fetchNextTask() : AbstractTask|null
Without the --task option we ask the scheduler for the next task with pending execution.
Tags
Return values
AbstractTask|nullgetTask()
Return task a task for a given UID
protected
getTask(int $taskUid) : AbstractTask|null
Parameters
- $taskUid : int
Return values
AbstractTask|nullloopTasks()
Execute tasks in loop that are ready to execute
protected
loopTasks() : bool
Return values
boolshouldStopTasks()
Checks if the tasks should be stopped instead of being executed.
protected
shouldStopTasks(bool $stopOption) : bool
Stopping is only performed when the --stop option is provided together with the --task option.
Parameters
- $stopOption : bool
Return values
boolstopTask()
Stop task
protected
stopTask(AbstractTask $task) : mixed
Parameters
- $task : AbstractTask