cron
in package
Table of Contents
Properties
- $_changed : bool
- $class : string
- $deamon : int
- $deamonSleepTime : int
- $enable : int
- $function : string
- $id : int
- $once : int
- $option : string|null
- $schedule : string
- $timeout : int
Methods
- all() : array<string|int, mixed>
- Return an array of all cron object
- byClassAndFunction() : object
- Return cron object corresponding to parameters
- byId() : object
- Get cron object associate to id
- clean() : void
- Removes invalid cron schedules
- convertDateToCron() : string
- Converts timestamp to cron expression
- getCache() : mixed
- getChanged() : bool
- getClass() : string
- getDeamon() : int
- getDeamonSleepTime() : int
- getEnable() : int
- getFunction() : string
- getId() : int
- getLastRun() : string
- getName() : string
- Get human name of cron
- getNextRunDate() : false|string
- Calculates next execution time
- getOnce() : int
- getOption() : mixed
- getPID() : int
- getPidFile() : int
- Return the current pid of jeecron or empty if not running
- getSchedule() : string
- getState() : string
- getTimeout() : int
- halt() : bool
- Forces immediate task termination
- isDue() : bool
- Check if it's time to launch cron
- jeeCronRun() : bool
- Return state of jeecron master
- loadAvg() : array<string|int, mixed>
- Return array of load average
- nbCronRun() : int
- Return number of cron running
- nbProcess() : int
- Return number of process on system
- postInsert() : void
- Initializes a new cron task
- preSave() : mixed
- Check if cron object is valid before save
- refresh() : bool
- Refresh DB state of this cron
- remove() : bool
- Remove cron object
- run() : mixed
- Launch cron (this method must be only call by jeecron master)
- running() : bool
- Check if this cron is currently running
- save() : bool
- Save cron object
- searchClassAndFunction() : array<string|int, cron>
- setCache() : void
- setChanged() : static
- setClass() : static
- setDeamon() : static
- setDeamonSleepTime() : static
- setEnable() : static
- setFunction() : static
- setId() : static
- setLastRun() : void
- setOnce() : static
- setOption() : static
- setPID() : void
- setPidFile() : mixed
- Set jeecron pid of current process
- setSchedule() : static
- setState() : void
- setTimeout() : static
- start() : mixed
- Set cron to be start
- stop() : void
- Signals task to stop
- toArray() : array<string, mixed>
- Converts task to array format
Properties
$_changed
private
bool
$_changed
= \false
Change tracking flag
$class
private
string
$class
= ''
Class name for class methods
$deamon
private
int
$deamon
= 0
Daemon mode status
$deamonSleepTime
private
int
$deamonSleepTime
Sleep time between daemon execution cycles
$enable
private
int
$enable
= 1
Task enabled status
$function
private
string
$function
Method to execute
$id
private
int
$id
Unique identifier
$once
private
int
$once
= 0
Single execution flag
$option
private
string|null
$option
JSON encoded options
$schedule
private
string
$schedule
= ''
Cron schedule expression
$timeout
private
int
$timeout
Maximum execution time in seconds
Methods
all()
Return an array of all cron object
public
static all([mixed $_order = false ]) : array<string|int, mixed>
Parameters
- $_order : mixed = false
Return values
array<string|int, mixed>byClassAndFunction()
Return cron object corresponding to parameters
public
static byClassAndFunction(string $_class, string $_function[, string $_option = '' ]) : object
Parameters
- $_class : string
- $_function : string
- $_option : string = ''
Return values
objectbyId()
Get cron object associate to id
public
static byId(int $_id) : object
Parameters
- $_id : int
Return values
objectclean()
Removes invalid cron schedules
public
static clean() : void
convertDateToCron()
Converts timestamp to cron expression
public
static convertDateToCron(int $_date) : string
Parameters
- $_date : int
-
Timestamp
Return values
string —Cron expression
getCache()
public
getCache([string $_key = '' ][, mixed $_default = '' ]) : mixed
Parameters
- $_key : string = ''
-
Cache key
- $_default : mixed = ''
-
Default value
getChanged()
public
getChanged() : bool
Return values
boolgetClass()
public
getClass() : string
Return values
stringgetDeamon()
public
getDeamon() : int
Return values
intgetDeamonSleepTime()
public
getDeamonSleepTime() : int
Return values
intgetEnable()
public
getEnable([int $_default = 0 ]) : int
Parameters
- $_default : int = 0
-
Default value
Return values
intgetFunction()
public
getFunction() : string
Return values
stringgetId()
public
getId() : int
Return values
intgetLastRun()
public
getLastRun() : string
Return values
stringgetName()
Get human name of cron
public
getName() : string
Return values
stringgetNextRunDate()
Calculates next execution time
public
getNextRunDate() : false|string
Return values
false|string —Next execution date or false on error
getOnce()
public
getOnce([int $_default = 0 ]) : int
Parameters
- $_default : int = 0
-
Default value
Return values
intgetOption()
public
getOption() : mixed
getPID()
public
getPID([int|null $_default = null ]) : int
Parameters
- $_default : int|null = null
-
Default value
Return values
intgetPidFile()
Return the current pid of jeecron or empty if not running
public
static getPidFile() : int
Return values
intgetSchedule()
public
getSchedule() : string
Return values
stringgetState()
public
getState() : string
Return values
stringgetTimeout()
public
getTimeout() : int
Return values
inthalt()
Forces immediate task termination
public
halt() : bool
Tags
Return values
bool —Success status
isDue()
Check if it's time to launch cron
public
isDue([mixed $_datetime = null ]) : bool
Parameters
- $_datetime : mixed = null
Return values
booljeeCronRun()
Return state of jeecron master
public
static jeeCronRun() : bool
Return values
boolloadAvg()
Return array of load average
public
static loadAvg() : array<string|int, mixed>
Return values
array<string|int, mixed>nbCronRun()
Return number of cron running
public
static nbCronRun() : int
Return values
intnbProcess()
Return number of process on system
public
static nbProcess() : int
Return values
intpostInsert()
Initializes a new cron task
public
postInsert() : void
preSave()
Check if cron object is valid before save
public
preSave() : mixed
Tags
refresh()
Refresh DB state of this cron
public
refresh() : bool
Return values
boolremove()
Remove cron object
public
remove([mixed $halt_before = true ]) : bool
Parameters
- $halt_before : mixed = true
Return values
boolrun()
Launch cron (this method must be only call by jeecron master)
public
run([mixed $_noErrorReport = false ]) : mixed
Parameters
- $_noErrorReport : mixed = false
Tags
running()
Check if this cron is currently running
public
running() : bool
Return values
boolsave()
Save cron object
public
save() : bool
Return values
boolsearchClassAndFunction()
public
static searchClassAndFunction(string $_class, string $_function[, string|array<string|int, mixed> $_option = '' ]) : array<string|int, cron>
Parameters
- $_class : string
- $_function : string
- $_option : string|array<string|int, mixed> = ''
Return values
array<string|int, cron>setCache()
public
setCache(string $_key[, mixed|null $_value = null ]) : void
Parameters
- $_key : string
-
Cache key
- $_value : mixed|null = null
-
Value to store
setChanged()
public
setChanged(bool $_changed) : static
Parameters
- $_changed : bool
Return values
staticsetClass()
public
setClass(string $_class) : static
Parameters
- $_class : string
Return values
staticsetDeamon()
public
setDeamon(int $_deamons) : static
Parameters
- $_deamons : int
Return values
staticsetDeamonSleepTime()
public
setDeamonSleepTime(int $_deamonSleepTime) : static
Parameters
- $_deamonSleepTime : int
Return values
staticsetEnable()
public
setEnable(int $_enable) : static
Parameters
- $_enable : int
Return values
staticsetFunction()
public
setFunction(string $_function) : static
Parameters
- $_function : string
Return values
staticsetId()
public
setId(int $_id) : static
Parameters
- $_id : int
Return values
staticsetLastRun()
public
setLastRun(string $lastRun) : void
Parameters
- $lastRun : string
setOnce()
public
setOnce(int $_once) : static
Parameters
- $_once : int
Return values
staticsetOption()
public
setOption(mixed $_option) : static
Parameters
- $_option : mixed
Return values
staticsetPID()
public
setPID([int $pid = null ]) : void
Parameters
- $pid : int = null
setPidFile()
Set jeecron pid of current process
public
static setPidFile() : mixed
setSchedule()
public
setSchedule(string $_schedule) : static
Parameters
- $_schedule : string
Return values
staticsetState()
public
setState(string $state) : void
Parameters
- $state : string
-
One of 'stop', 'starting', 'run', 'stoping', 'error', 'Not found'
setTimeout()
public
setTimeout(int $_timeout) : static
Parameters
- $_timeout : int
Return values
staticstart()
Set cron to be start
public
start() : mixed
stop()
Signals task to stop
public
stop() : void
toArray()
Converts task to array format
public
toArray() : array<string, mixed>
Return values
array<string, mixed> —Task properties