PHP Class Aoe_Scheduler_Helper_Data, Aoe_Scheduler

Author: Fabrizio Branca
Inheritance: extends Mage_Core_Helper_Abstract
Show file Open project: aoepeople/aoe_scheduler

Protected Properties

Property Type Description
$groupsToJobsMap

Public Methods

Method Description
addGroupJobs ( array $jobs, array $groups )
checkCachePrefix ( ) : boolean Check if the cache prefix from the database matches the cache prefix from the local.xml file
dateDiff ( $time1, $time2 = null ) : integer Diff between to times;
decorateStatus ( $status ) : string Decorate status values
decorateTime ( string $value, boolean $echoToday = false, string $dateFormat = null ) : string Decorate time values
decorateTimeFrameCallBack ( string $value ) : string Wrapper for decorateTime to be used a frame_callback to avoid that additional parameters conflict with the method's optional ones
getCallBack ( $runModel ) : array Get callback from runModel
getConfiguredUser ( ) : string | null Return the configured cron user
getDbCachePrefix ( )
getGroupsToJobsMap ( $forceRebuild = false )
getLastExecutionTime ( $jobCode ) : boolean Get last execution time
getLastHeartbeat ( ) Get last heartbeat
getLastRunUser ( ) : string | null Get the last user who ran a schedule from core variables
getRunningUser ( ) : string Return the current system user running this process
getShouldKillOnWrongUser ( ) : boolean Should processes not running the configured user be killed?
getShowUserCronMessage ( ) : boolean Should we warn the user if the schedule is being run as the wrong user?
isDisabled ( $jobCode ) : boolean Check if job code is disabled in configuration
matchesIncludeExclude ( $jobCode, array $include, array $exclude ) : mixed Check if a job matches the group include/exclude lists
runningAsConfiguredUser ( boolean $useRunningUser = true ) : boolean Check the configuration value for which user the cron should be run as, and check if it matches the actual user.
sendErrorMail ( Aoe_Scheduler_Model_Schedule $schedule, $error ) : void Send error mail
trimExplode ( $delim, string $string, boolean $removeEmptyValues = false ) : array Explodes a string and trims all values for whitespace in the ends.
validateCronExpression ( $cronExpression ) : boolean Validate cron expression

Method Details

addGroupJobs() public method

public addGroupJobs ( array $jobs, array $groups )
$jobs array
$groups array

checkCachePrefix() public method

Check if the cache prefix from the database matches the cache prefix from the local.xml file
public checkCachePrefix ( ) : boolean
return boolean

dateDiff() public method

Diff between to times;
public dateDiff ( $time1, $time2 = null ) : integer
$time1
$time2
return integer

decorateStatus() public method

Decorate status values
public decorateStatus ( $status ) : string
$status
return string

decorateTime() public method

Decorate time values
public decorateTime ( string $value, boolean $echoToday = false, string $dateFormat = null ) : string
$value string
$echoToday boolean if true "Today" will be added
$dateFormat string make sure Y-m-d is in it, if you want to have it replaced
return string

decorateTimeFrameCallBack() public method

Wrapper for decorateTime to be used a frame_callback to avoid that additional parameters conflict with the method's optional ones
public decorateTimeFrameCallBack ( string $value ) : string
$value string
return string

getCallBack() public method

Get callback from runModel
public getCallBack ( $runModel ) : array
$runModel
return array

getConfiguredUser() public method

Return the configured cron user
public getConfiguredUser ( ) : string | null
return string | null

getDbCachePrefix() public method

public getDbCachePrefix ( )

getGroupsToJobsMap() public method

public getGroupsToJobsMap ( $forceRebuild = false )

getLastExecutionTime() public method

Get last execution time
public getLastExecutionTime ( $jobCode ) : boolean
$jobCode
return boolean

getLastHeartbeat() public method

Get last heartbeat
public getLastHeartbeat ( )

getLastRunUser() public method

Get the last user who ran a schedule from core variables
public getLastRunUser ( ) : string | null
return string | null

getRunningUser() public method

Return the current system user running this process
public getRunningUser ( ) : string
return string

getShouldKillOnWrongUser() public method

Should processes not running the configured user be killed?

getShowUserCronMessage() public method

Should we warn the user if the schedule is being run as the wrong user?
public getShowUserCronMessage ( ) : boolean
return boolean

isDisabled() public method

Check if job code is disabled in configuration
public isDisabled ( $jobCode ) : boolean
$jobCode
return boolean

matchesIncludeExclude() public method

Check if a job matches the group include/exclude lists
public matchesIncludeExclude ( $jobCode, array $include, array $exclude ) : mixed
$jobCode
$include array
$exclude array
return mixed

runningAsConfiguredUser() public method

Skip if the warning should be ignored.
public runningAsConfiguredUser ( boolean $useRunningUser = true ) : boolean
$useRunningUser boolean If true, use the user running the web server, otherwise use the last run user from core_variable storage
return boolean

sendErrorMail() public method

Send error mail
public sendErrorMail ( Aoe_Scheduler_Model_Schedule $schedule, $error ) : void
$schedule Aoe_Scheduler_Model_Schedule
$error
return void

trimExplode() public method

If $onlyNonEmptyValues is set, then all blank ('') values are removed.
See also: t3lib_div::trimExplode() in TYPO3
public trimExplode ( $delim, string $string, boolean $removeEmptyValues = false ) : array
$delim
$string string
$removeEmptyValues boolean If set, all empty values will be removed in output
return array Exploded values

validateCronExpression() public method

Validate cron expression
public validateCronExpression ( $cronExpression ) : boolean
$cronExpression
return boolean

Property Details

$groupsToJobsMap protected property

protected $groupsToJobsMap