runScheduledTasks Class Reference
[Tools]

CLI tool to execute a set of scheduled tasks. More...

Inheritance diagram for runScheduledTasks:

CommandLineTool

List of all members.

Public Member Functions

 checkFrequency ($className, $frequency)
 execute ()
 executeTask ($className, $args)
 getTaskArgs ($task)
 isInNumericRange ($value, $min, $max)
 isInRange ($rangeStr, $currentValue, $lastTimestamp, $timeCompareStr, $cutoffTimestamp)
 parseTasks ($file)
 runScheduledTasks ($argv=array())
 usage ()


Detailed Description

CLI tool to execute a set of scheduled tasks.

Definition at line 26 of file runScheduledTasks.php.


Member Function Documentation

runScheduledTasks.checkFrequency ( className,
frequency 
)

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

Parameters:
$className string
$frequency XMLNode
Returns:
string

Definition at line 150 of file runScheduledTasks.php.

References isInRange().

Referenced by parseTasks().

runScheduledTasks.execute (  ) 

Parse and execute the scheduled tasks.

Definition at line 68 of file runScheduledTasks.php.

References parseTasks().

runScheduledTasks.executeTask ( className,
args 
)

Execute the specified task.

Parameters:
$className string the class name to execute
$args array the array of arguments to pass to the class constructors

Definition at line 110 of file runScheduledTasks.php.

Referenced by parseTasks().

runScheduledTasks.getTaskArgs ( task  ) 

Get the arguments for a task from the parsed XML.

Parameters:
XMLNode 
Returns:
array

Definition at line 131 of file runScheduledTasks.php.

Referenced by parseTasks().

runScheduledTasks.isInNumericRange ( value,
min,
max 
)

Check if a numeric value is within the specified range.

Parameters:
$value int
$min int
$max int
Returns:
boolean

Definition at line 255 of file runScheduledTasks.php.

Referenced by isInRange().

runScheduledTasks.isInRange ( rangeStr,
currentValue,
lastTimestamp,
timeCompareStr,
cutoffTimestamp 
)

Check if a value is within the specified range.

Parameters:
$rangeStr string the range (e.g., 0, 1-5, *, etc.)
$currentValue int value to check if its in the range
$lastTimestamp int the last time the task was executed
$timeCompareStr string value to use in strtotime("-X $timeCompareStr")
$cutoffTimestamp int value will be considered valid if older than this
Returns:
boolean

Definition at line 204 of file runScheduledTasks.php.

References isInNumericRange().

Referenced by checkFrequency().

runScheduledTasks.parseTasks ( file  ) 

Parse and execute the scheduled tasks in the specified file.

Parameters:
$file string

Definition at line 76 of file runScheduledTasks.php.

References checkFrequency(), executeTask(), and getTaskArgs().

Referenced by execute().

runScheduledTasks.runScheduledTasks ( argv = array()  ) 

Constructor.

Parameters:
$argv array command-line arguments If specified, the first parameter should be the path to a tasks XML descriptor file (other than the default)

Definition at line 40 of file runScheduledTasks.php.

References CommandLineTool.$argv, and DAORegistry.getDAO().

runScheduledTasks.usage (  ) 

Print command usage information.

Reimplemented from CommandLineTool.

Definition at line 60 of file runScheduledTasks.php.


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

Generated on Mon Jul 14 10:55:46 2008 for Open Journal Systems by  doxygen 1.5.6