Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
ScheduledTaskHelper Class Reference

Public Member Functions

 _isInNumericRange ($value, $min, $max)
 
 _isInRange ($rangeStr, $currentValue, $lastTimestamp, $timeCompareStr, $cutoffTimestamp)
 
 checkFrequency ($className, $frequency)
 
 getTaskArgs ($task)
 

Detailed Description

Helper class for common scheduled tasks operations.

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

Member Function Documentation

ScheduledTaskHelper::_isInNumericRange (   $value,
  $min,
  $max 
)

Check if a numeric value is within the specified range.

Parameters
$valueint
$minint
$maxint
Returns
boolean

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

Referenced by _isInRange().

ScheduledTaskHelper::_isInRange (   $rangeStr,
  $currentValue,
  $lastTimestamp,
  $timeCompareStr,
  $cutoffTimestamp 
)

Check if a value is within the specified range.

Parameters
$rangeStrstring the range (e.g., 0, 1-5, *, etc.)
$currentValueint value to check if its in the range
$lastTimestampint the last time the task was executed
$timeCompareStrstring value to use in strtotime("-X $timeCompareStr")
$cutoffTimestampint value will be considered valid if older than this
Returns
boolean

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

References _isInNumericRange().

Referenced by checkFrequency().

ScheduledTaskHelper::checkFrequency (   $className,
  $frequency 
)

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 43 of file ScheduledTaskHelper.inc.php.

References _isInRange(), and DAORegistry\getDAO().

Referenced by AcronPlugin\callbackLoadHandler(), and ScheduledTaskTool\parseTasks().

ScheduledTaskHelper::getTaskArgs (   $task)

Get the arguments for a task from the parsed XML.

Parameters
XMLNode
Returns
array

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

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


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