\FAACronHandler

Summary

Methods
Properties
Constants
GetId()
CreateHandler()
ListHandlers()
Id2Path()
GetRegisteredJobHandler()
GetRegisteredJob()
ListQueue()
ExecuteMaster()
ListWaitingJobs()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
ExecuteJob()
ExecuteRegisteredJobs()
ExecuteWaitingJobs()
$running
$ids
N/A

Properties

$running

$running : integer

counter of running jobs

Type

integer

$ids

$ids : array

unique id buffer

Type

array

Methods

GetId()

GetId() : integer

Get new id

Create a new job id

Returns

integer —

a new id for jobs

CreateHandler()

CreateHandler(  $data) : \FAA\Obj\Result

Create a new cronjob with handler function from template

Parameters

$data

Returns

\FAA\Obj\Result

ListHandlers()

ListHandlers(string  $language = null, boolean  $raw = false) : \FAA\Obj\Result

list job handlers interface to show the list of all job parent definitions from object storage

Parameters

string $language

The target language of the job definition object

boolean $raw

Add raw or, as plain list for view

Returns

\FAA\Obj\Result

A system result object

Id2Path()

Id2Path(integer  $id, string  $name, boolean  $create = true) : string

id and name to path create and load a job working directory

Parameters

integer $id

The job primary

string $name

The job name

boolean $create

If not existing, create the directory

Returns

string —

The path to the jobs working directory

GetRegisteredJobHandler()

GetRegisteredJobHandler(  $name) : \FAA\Obj\CronJob|null

Get a cron job instance handler

Parameters

$name

Returns

\FAA\Obj\CronJob|null

GetRegisteredJob()

GetRegisteredJob(integer  $id, string  $name) : \FAA\Obj\Result

get single job load a single registered cronjob for detail operations

Parameters

integer $id

The job primary

string $name

The job name

Returns

\FAA\Obj\Result

A default system result object containing the handler

ListQueue()

ListQueue(string  $language = null, array  $filter = array()) : \FAA\Obj\Result

list queue of jobs interface to show the list of all jobs inside the queue will be returned with status of job and some additional information like the temp path or, the pid

Parameters

string $language

The target language of the job definition object

array $filter

A set of filters

Returns

\FAA\Obj\Result

A system result object

ExecuteMaster()

ExecuteMaster(string  $ident, integer  $primary, string  $name, boolean  $force = false) 

execute master job interface called from cron.php, will either start a single job or, the master job is secured by static token in cfg/locales.php

Parameters

string $ident

The identification code

integer $primary

The job primary or null when master called

string $name

The job name or null when master called

boolean $force

Force execution when job is awaited but has no runat definition

ListWaitingJobs()

ListWaitingJobs(string  $name) : array

Get the waiting cronjob list Fetch the list of waiting cronjob entries as minimal objects with name and id

Parameters

string $name

The name of the cronjob type to load

Returns

array —

A list of cronjob instance references

ExecuteJob()

ExecuteJob(integer  $id, string  $name) 

Execute single job

Will load the job from temp storage queue, register a handler and call the handler Execute() method will also update the public status of the job, depending on jobs execute result This method does a redirect of the log file to the cron log

Parameters

integer $id

Register id of the job (defined by file name)

string $name

The handler name of this job

ExecuteRegisteredJobs()

ExecuteRegisteredJobs(boolean  $force) 

execute jobs execute the timely registered master jobs will execute cronjob list based on the time definition in the parent objects, when the job is ready for execution it will be added as a copy to the execution queue

Parameters

boolean $force

Force execution when job is awaited but has no runat definition

ExecuteWaitingJobs()

ExecuteWaitingJobs(string  $name, \FAA\Obj\CronJob  $handler) 

execute waiting cron jobs load waiting cron jobs and then execute them

Parameters

string $name

Name of the cronjob type to execute

\FAA\Obj\CronJob $handler

A handler object