PHP 클래스 Aoe_Scheduler_Model_Schedule, Aoe_Scheduler

상속: extends Mage_Cron_Model_Schedule
파일 보기 프로젝트 열기: aoepeople/aoe_scheduler 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_eventObject string In an observer method you can use $observer->getData('schedule') or $observer->getData('data_object') to get this object
$_eventPrefix string Event name prefix for events that are dispatched by this class
$_redirect boolean Placeholder to keep track of active redirect buffer.
$_redirectOutputHandlerChunkSize Prior to PHP 5.4.0, the value 1 set the chunk size to 4096 bytes.
$errorSettingsBackup array Backup of the original error settings
$job Aoe_Scheduler_Model_Job
$jobWasLocked boolean

공개 메소드들

메소드 설명
_addBufferToMessages ( $buffer ) : string Used as callback function to redirect the output buffer directly into the messages field of this schedule.
addMessages ( $messages ) Append data to the current messages field.
canRun ( boolean $throwException = false ) : boolean Check if this schedule can be run
checkPid ( ) : boolean Check if process is running (linux only)
checkRunningAsCorrectUser ( ) : boolean Check if the user running the process matches the configured user. Message will capture cases where the user is not set too in its response message. Process may optionally be killed, or may be allowed to continue.
getAllStatuses ( )
getDuration ( ) : boolean | integer Get job duration.
getErrorLogFile ( ) : string Get error log filename
getJob ( ) : Aoe_Scheduler_Model_Job Get job configuration
getJobWasLocked ( ) : boolean Flag that shows that a previous execution was prevented because the job was locked
getParameters ( ) : mixed Get parameters (and fallback to job)
getStarttime ( ) : string Get start time (planned or actual)
getStatuses ( ) : array Gets statuses that are currently in the scheduler table
initializeFromJob ( Aoe_Scheduler_Model_Job $job ) Initialize from job
isAlive ( ) : boolean | null Is this process still alive?
isAlwaysTask ( ) : boolean Check if this is an "always" task
kill ( ) : void Kill this process
markAsDisappeared ( string $message = null ) : void Mark task as disappeared
process ( ) Process schedule
refresh ( ) Get fresh version of this object
requestKill ( integer $time = null, string $message = null ) Request kill
runNow ( boolean $tryLockJob = true, boolean $forceRun = false ) : Aoe_Scheduler_Model_Schedule Run this task now
saveMessages ( ) Save the messages directly to the schedule record.
schedule ( integer $time = null ) : Aoe_Scheduler_Model_Schedule Schedule this task to be executed at a given time
scheduleNow ( ) : Aoe_Scheduler_Model_Schedule Schedule this task to be executed as soon as possible
setCronExpr ( $expr ) Bypass parent's setCronExpr is the expression is "always" This will break trySchedule, but always tasks will never be tried to scheduled anyway
setLastRunUser ( string | null $user = null ) : self Set the user who ran the last successfully started schedule into a core variable

보호된 메소드들

메소드 설명
_beforeSave ( ) : Mage_Core_Model_Abstract Processing object before save data
_getPdoWarning ( PDO $pdo ) : mixed Retrieve the last PDO warning.
_startBufferToMessages ( ) Redirect all output to the messages field of this Schedule.
_stopBufferToMessages ( ) Stop redirecting all output to the messages field of this Schedule.
jobErrorContext ( ) Switch the job error context
log ( $message, null $level = null ) Log message to configured log file (or skip)
restoreErrorContext ( ) Restore the original error context

메소드 상세

_addBufferToMessages() 공개 메소드

Used as callback function to redirect the output buffer directly into the messages field of this schedule.
public _addBufferToMessages ( $buffer ) : string
$buffer
리턴 string

_beforeSave() 보호된 메소드

Check if there are other schedules for the same job at the same time and skip saving in this case.
protected _beforeSave ( ) : Mage_Core_Model_Abstract
리턴 Mage_Core_Model_Abstract

_getPdoWarning() 보호된 메소드

Retrieve the last PDO warning.
protected _getPdoWarning ( PDO $pdo ) : mixed
$pdo PDO
리턴 mixed

_startBufferToMessages() 보호된 메소드

We use ob_start with _addBufferToMessages to redirect the output.
protected _startBufferToMessages ( )

_stopBufferToMessages() 보호된 메소드

We use ob_end_flush to stop redirecting the output.
protected _stopBufferToMessages ( )

addMessages() 공개 메소드

Append data to the current messages field.
public addMessages ( $messages )
$messages

canRun() 공개 메소드

Check if this schedule can be run
public canRun ( boolean $throwException = false ) : boolean
$throwException boolean
리턴 boolean

checkPid() 공개 메소드

Check if process is running (linux only)
public checkPid ( ) : boolean
리턴 boolean

checkRunningAsCorrectUser() 공개 메소드

Check if the user running the process matches the configured user. Message will capture cases where the user is not set too in its response message. Process may optionally be killed, or may be allowed to continue.

getAllStatuses() 공개 메소드

public getAllStatuses ( )

getDuration() 공개 메소드

Get job duration.
public getDuration ( ) : boolean | integer
리턴 boolean | integer time in seconds, or false

getErrorLogFile() 공개 메소드

Get error log filename
public getErrorLogFile ( ) : string
리턴 string

getJob() 공개 메소드

Get job configuration
public getJob ( ) : Aoe_Scheduler_Model_Job
리턴 Aoe_Scheduler_Model_Job

getJobWasLocked() 공개 메소드

Flag that shows that a previous execution was prevented because the job was locked
public getJobWasLocked ( ) : boolean
리턴 boolean

getParameters() 공개 메소드

Get parameters (and fallback to job)
public getParameters ( ) : mixed
리턴 mixed

getStarttime() 공개 메소드

Get start time (planned or actual)
public getStarttime ( ) : string
리턴 string

getStatuses() 공개 메소드

Gets statuses that are currently in the scheduler table
public getStatuses ( ) : array
리턴 array

initializeFromJob() 공개 메소드

Initialize from job
public initializeFromJob ( Aoe_Scheduler_Model_Job $job )
$job Aoe_Scheduler_Model_Job

isAlive() 공개 메소드

true -> alive false -> dead null -> we don't know because the task is running on a different server
public isAlive ( ) : boolean | null
리턴 boolean | null

isAlwaysTask() 공개 메소드

Check if this is an "always" task
public isAlwaysTask ( ) : boolean
리턴 boolean

jobErrorContext() 보호된 메소드

Switch the job error context
protected jobErrorContext ( )

kill() 공개 메소드

Kill this process
public kill ( ) : void
리턴 void

log() 보호된 메소드

Log message to configured log file (or skip)
protected log ( $message, null $level = null )
$message
$level null

markAsDisappeared() 공개 메소드

Mark task as disappeared
public markAsDisappeared ( string $message = null ) : void
$message string
리턴 void

process() 공개 메소드

Process schedule
public process ( )

refresh() 공개 메소드

Get fresh version of this object
public refresh ( )

requestKill() 공개 메소드

Request kill
public requestKill ( integer $time = null, string $message = null )
$time integer
$message string

restoreErrorContext() 보호된 메소드

Restore the original error context
protected restoreErrorContext ( )

runNow() 공개 메소드

Run this task now
public runNow ( boolean $tryLockJob = true, boolean $forceRun = false ) : Aoe_Scheduler_Model_Schedule
$tryLockJob boolean
$forceRun boolean
리턴 Aoe_Scheduler_Model_Schedule

saveMessages() 공개 메소드

If the messages field was not updated in the database, check if this is because of data truncation and fix the message length.
public saveMessages ( )

schedule() 공개 메소드

Schedule this task to be executed at a given time
public schedule ( integer $time = null ) : Aoe_Scheduler_Model_Schedule
$time integer
리턴 Aoe_Scheduler_Model_Schedule

scheduleNow() 공개 메소드

Schedule this task to be executed as soon as possible
사용 중단: use Aoe_Scheduler_Model_Schedule::schedule() instead
public scheduleNow ( ) : Aoe_Scheduler_Model_Schedule
리턴 Aoe_Scheduler_Model_Schedule

setCronExpr() 공개 메소드

Bypass parent's setCronExpr is the expression is "always" This will break trySchedule, but always tasks will never be tried to scheduled anyway
public setCronExpr ( $expr )
$expr

setLastRunUser() 공개 메소드

Set the user who ran the last successfully started schedule into a core variable
public setLastRunUser ( string | null $user = null ) : self
$user string | null Optional: if specified, overrides the default
리턴 self

프로퍼티 상세

$_eventObject 보호되어 있는 프로퍼티

In an observer method you can use $observer->getData('schedule') or $observer->getData('data_object') to get this object
protected string $_eventObject
리턴 string

$_eventPrefix 보호되어 있는 프로퍼티

Event name prefix for events that are dispatched by this class
protected string $_eventPrefix
리턴 string

$_redirect 보호되어 있는 프로퍼티

Placeholder to keep track of active redirect buffer.
protected bool $_redirect
리턴 boolean

$_redirectOutputHandlerChunkSize 보호되어 있는 프로퍼티

Prior to PHP 5.4.0, the value 1 set the chunk size to 4096 bytes.
protected $_redirectOutputHandlerChunkSize

$errorSettingsBackup 보호되어 있는 프로퍼티

Backup of the original error settings
protected array $errorSettingsBackup
리턴 array

$job 보호되어 있는 프로퍼티

protected Aoe_Scheduler_Model_Job $job
리턴 Aoe_Scheduler_Model_Job

$jobWasLocked 보호되어 있는 프로퍼티

protected bool $jobWasLocked
리턴 boolean