Open Journal Systems  3.3.0
ScheduledTaskHelper Class Reference

Public Member Functions

 __construct ($email='', $contactName='')
 
 getMail ()
 
 getMessage ($executionLogFile)
 
 notifyExecutionResult ($id, $name, $result, $executionLogFile='')
 

Static Public Member Functions

static checkFrequency ($className, $frequency)
 
static clearExecutionLogs ()
 
static downloadExecutionLog ($file)
 
static getTaskArgs ($task)
 

Data Fields

 $_contactEmail
 
 $_contactName
 

Detailed Description

Helper class for common scheduled tasks operations.

Definition at line 22 of file ScheduledTaskHelper.inc.php.

Constructor & Destructor Documentation

◆ __construct()

ScheduledTaskHelper::__construct (   $email = '',
  $contactName = '' 
)

Constructor. Ovewrites both parameters if one is not passed.

Parameters
$emailstring (optional)
$contactNamestring (optional)

Definition at line 42 of file ScheduledTaskHelper.inc.php.

References DAORegistry\getDAO().

Member Function Documentation

◆ checkFrequency()

static ScheduledTaskHelper::checkFrequency (   $className,
  $frequency 
)
static

Check if the specified task should be executed according to the specified frequency and its last run time.

Parameters
$classNamestring
$frequencyXMLNode
Returns
string

Definition at line 89 of file ScheduledTaskHelper.inc.php.

References DAORegistry\getDAO().

Referenced by PKPAcronPlugin\_getTasksToRun(), and ScheduledTaskTool\parseTasks().

◆ clearExecutionLogs()

static ScheduledTaskHelper::clearExecutionLogs ( )
static

Clear tasks execution log files.

Definition at line 190 of file ScheduledTaskHelper.inc.php.

Referenced by AdminHandler\clearScheduledTaskLogFiles().

◆ downloadExecutionLog()

static ScheduledTaskHelper::downloadExecutionLog (   $file)
static

Download execution log file.

Parameters
$filestring

Definition at line 201 of file ScheduledTaskHelper.inc.php.

Referenced by AdminHandler\downloadScheduledTaskLogFile().

◆ getMail()

ScheduledTaskHelper::getMail ( )

Get mail object.

Returns
Mail

Definition at line 59 of file ScheduledTaskHelper.inc.php.

◆ getMessage()

ScheduledTaskHelper::getMessage (   $executionLogFile)

Get execution log email message.

Parameters
$executionLogFilestring
Returns
string

Definition at line 170 of file ScheduledTaskHelper.inc.php.

References PKPApplication\get(), and Application\getNameKey().

Referenced by notifyExecutionResult().

◆ getTaskArgs()

static ScheduledTaskHelper::getTaskArgs (   $task)
static

Get the arguments for a task from the parsed XML.

Parameters
XMLNode
Returns
array

Definition at line 70 of file ScheduledTaskHelper.inc.php.

Referenced by PKPAcronPlugin\_parseCrontab(), and ScheduledTaskTool\parseTasks().

◆ notifyExecutionResult()

ScheduledTaskHelper::notifyExecutionResult (   $id,
  $name,
  $result,
  $executionLogFile = '' 
)

Notifies site administrator about the task execution result.

Parameters
$idint Task id.
$namestring Task name.
$resultboolean Whether or not the task execution was successful.
$executionLogFilestring Task execution log file path.

Definition at line 144 of file ScheduledTaskHelper.inc.php.

References getMessage(), and Config\getVar().

Field Documentation

◆ $_contactEmail

string ScheduledTaskHelper::$_contactEmail

Contact email.

Definition at line 28 of file ScheduledTaskHelper.inc.php.

◆ $_contactName

string ScheduledTaskHelper::$_contactName

Contact name.

Definition at line 34 of file ScheduledTaskHelper.inc.php.


The documentation for this class was generated from the following file: