Cron
in package
implements
WorkerManagerInterface
Cron jobs
Table of Contents
Interfaces
- WorkerManagerInterface
- Queue worker manager interface
Properties
- $command : string
- Cron command
- $currentUser : string
- Current user
- $interval : string
- Crontab interval
Methods
- __construct() : mixed
- Constructor
- addJob() : mixed|false
- Add cron tab job
- addJobs() : mixed|false
- Add cron tab jobs
- getCronCommand() : string
- Get cron command
- getDescription() : string|null
- Get description
- getDetails() : array<string|int, mixed>
- get cron details.
- getHost() : string
- Get port
- getJobs() : array<string|int, mixed>
- Get crontab jobs
- getPort() : string
- Get host
- getTitle() : string
- Get title
- hasJob() : bool
- Return true if crontab have job
- hasJobs() : bool
- Return true if crontab have jobs
- isCronCommand() : bool
- Retrun true if command is crontab command
- isRunning() : bool
- Return true if crontab entry is exists
- reInstall() : mixed
- Reinstall cron entry for scheduler
- removeAll() : mixed
- Remove all job from crontab
- removeJob() : bool
- Delete crontab job
- run() : bool
- Add cron entry for scheduler
- runCronCommand() : mixed|false
- Run cron command
- stop() : mixed
- Remove cron entry for scheduler
Properties
$command
Cron command
private
static string
$command
= 'cli scheduler >> /dev/null 2>&1'
$currentUser
Current user
private
string
$currentUser
$interval
Crontab interval
private
string
$interval
= '5'
Methods
__construct()
Constructor
public
__construct([string $interval = '5' ]) : mixed
Parameters
- $interval : string = '5'
addJob()
Add cron tab job
public
addJob(string $command) : mixed|false
Parameters
- $command : string
Return values
mixed|falseaddJobs()
Add cron tab jobs
public
addJobs(array<string|int, mixed> $commands) : mixed|false
Parameters
- $commands : array<string|int, mixed>
Return values
mixed|falsegetCronCommand()
Get cron command
public
static getCronCommand([string $minutes = '5' ]) : string
Parameters
- $minutes : string = '5'
Return values
stringgetDescription()
Get description
public
getDescription() : string|null
Return values
string|nullgetDetails()
get cron details.
public
getDetails() : array<string|int, mixed>
Return values
array<string|int, mixed>getHost()
Get port
public
getHost() : string
Return values
stringgetJobs()
Get crontab jobs
public
getJobs() : array<string|int, mixed>
Return values
array<string|int, mixed>getPort()
Get host
public
getPort() : string
Return values
stringgetTitle()
Get title
public
getTitle() : string
Return values
stringhasJob()
Return true if crontab have job
public
hasJob(string $command) : bool
Parameters
- $command : string
Return values
boolhasJobs()
Return true if crontab have jobs
public
hasJobs(array<string|int, mixed> $jobs) : bool
Parameters
- $jobs : array<string|int, mixed>
Return values
boolisCronCommand()
Retrun true if command is crontab command
public
static isCronCommand(string $command) : bool
Parameters
- $command : string
Return values
boolisRunning()
Return true if crontab entry is exists
public
isRunning() : bool
Return values
boolreInstall()
Reinstall cron entry for scheduler
public
reInstall() : mixed
removeAll()
Remove all job from crontab
public
removeAll() : mixed
removeJob()
Delete crontab job
public
removeJob(string $command) : bool
Parameters
- $command : string
Return values
boolrun()
Add cron entry for scheduler
public
run() : bool
Return values
boolrunCronCommand()
Run cron command
public
static runCronCommand() : mixed|false
Return values
mixed|falsestop()
Remove cron entry for scheduler
public
stop() : mixed