PHP 클래스 omnilight\scheduling\Event

상속: extends yii\base\Component
파일 보기 프로젝트 열기: omnilight/yii2-scheduling 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$command string Command string

보호된 프로퍼티들

프로퍼티 타입 설명
$_afterCallbacks array The array of callbacks to be run after the event is finished.
$_description string The human readable description of the event.
$_expression string The cron expression representing the event's frequency.
$_filter Closure The filter callback.
$_output string The location that output should be sent to.
$_reject Closure The reject callback.
$_timezone DateTimeZone | string The timezone the date should be evaluated on.
$_user string The user the command should run as.

공개 메소드들

메소드 설명
__construct ( string $command, array $config = [] ) Create a new event instance.
at ( string $time ) Schedule the command at a given time.
buildCommand ( ) : string Build the comand string.
cron ( string $expression ) The Cron expression representing the event's frequency.
daily ( ) Schedule the event to run daily.
dailyAt ( string $time ) Schedule the event to run daily at a given time (10:00, 19:30, etc).
days ( array | integer $days ) Set the days of the week the command should run on.
description ( string $description ) Set the human-friendly description of the event.
emailOutputTo ( array $addresses ) E-mail the results of the scheduled operation.
everyFiveMinutes ( ) Schedule the event to run every five minutes.
everyMinute ( ) Schedule the event to run every minute.
everyNMinutes ( integer | string $minutes ) Schedule the event to run every N minutes.
everyTenMinutes ( ) Schedule the event to run every ten minutes.
everyThirtyMinutes ( ) Schedule the event to run every thirty minutes.
fridays ( ) Schedule the event to run only on Fridays.
getDefaultOutput ( )
getExpression ( ) : string Get the Cron expression for the event.
getSummaryForDisplay ( ) : string Get the summary of the event for display.
hourly ( ) Schedule the event to run hourly.
isDue ( Application $app ) : boolean Determine if the given event should run based on the Cron expression.
mondays ( ) Schedule the event to run only on Mondays.
monthly ( ) Schedule the event to run monthly.
run ( Application $app ) Run the given event.
saturdays ( ) Schedule the event to run only on Saturdays.
sendOutputTo ( string $location ) Send the output of the command to a given location.
skip ( Closure $callback ) Register a callback to further filter the schedule.
sundays ( ) Schedule the event to run only on Sundays.
then ( Closure $callback ) Register a callback to be called after the operation.
thenPing ( string $url ) Register a callback to the ping a given URL after the job runs.
thursdays ( ) Schedule the event to run only on Thursdays.
timezone ( DateTimeZone | string $timezone ) Set the timezone the date should be evaluated on.
tuesdays ( ) Schedule the event to run only on Tuesdays.
twiceDaily ( ) Schedule the event to run twice daily.
user ( string $user ) Set which user the command should run as.
wednesdays ( ) Schedule the event to run only on Wednesdays.
weekdays ( ) Schedule the event to run only on weekdays.
weekly ( ) Schedule the event to run weekly.
weeklyOn ( integer $day, string $time = '0:0' ) Schedule the event to run weekly on a given day and time.
when ( Closure $callback ) Register a callback to further filter the schedule.
yearly ( ) Schedule the event to run yearly.

보호된 메소드들

메소드 설명
callAfterCallbacks ( Application $app ) Call all of the "after" callbacks for the event.
emailOutput ( yii\mail\MailerInterface $mailer, array $addresses ) E-mail the output of the event to the recipients.
expressionPasses ( ) : boolean Determine if the Cron expression passes.
filtersPass ( Application $app ) : boolean Determine if the filters pass for the event.
getEmailSubject ( ) : string Get the e-mail subject line for output results.
runCommandInBackground ( Application $app ) Run the command in the background using exec.
runCommandInForeground ( Application $app ) Run the command in the foreground.
spliceIntoPosition ( integer $position, string $value ) : Event Splice the given value into the given position of the expression.

메소드 상세

__construct() 공개 메소드

Create a new event instance.
public __construct ( string $command, array $config = [] )
$command string
$config array

at() 공개 메소드

Schedule the command at a given time.
public at ( string $time )
$time string

buildCommand() 공개 메소드

Build the comand string.
public buildCommand ( ) : string
리턴 string

callAfterCallbacks() 보호된 메소드

Call all of the "after" callbacks for the event.
protected callAfterCallbacks ( Application $app )
$app yii\base\Application

cron() 공개 메소드

The Cron expression representing the event's frequency.
public cron ( string $expression )
$expression string

daily() 공개 메소드

Schedule the event to run daily.
public daily ( )

dailyAt() 공개 메소드

Schedule the event to run daily at a given time (10:00, 19:30, etc).
public dailyAt ( string $time )
$time string

days() 공개 메소드

Set the days of the week the command should run on.
public days ( array | integer $days )
$days array | integer

description() 공개 메소드

Set the human-friendly description of the event.
public description ( string $description )
$description string

emailOutput() 보호된 메소드

E-mail the output of the event to the recipients.
protected emailOutput ( yii\mail\MailerInterface $mailer, array $addresses )
$mailer yii\mail\MailerInterface
$addresses array

emailOutputTo() 공개 메소드

E-mail the results of the scheduled operation.
public emailOutputTo ( array $addresses )
$addresses array

everyFiveMinutes() 공개 메소드

Schedule the event to run every five minutes.
public everyFiveMinutes ( )

everyMinute() 공개 메소드

Schedule the event to run every minute.
public everyMinute ( )

everyNMinutes() 공개 메소드

Schedule the event to run every N minutes.
public everyNMinutes ( integer | string $minutes )
$minutes integer | string

everyTenMinutes() 공개 메소드

Schedule the event to run every ten minutes.
public everyTenMinutes ( )

everyThirtyMinutes() 공개 메소드

Schedule the event to run every thirty minutes.
public everyThirtyMinutes ( )

expressionPasses() 보호된 메소드

Determine if the Cron expression passes.
protected expressionPasses ( ) : boolean
리턴 boolean

filtersPass() 보호된 메소드

Determine if the filters pass for the event.
protected filtersPass ( Application $app ) : boolean
$app yii\base\Application
리턴 boolean

fridays() 공개 메소드

Schedule the event to run only on Fridays.
public fridays ( )

getDefaultOutput() 공개 메소드

public getDefaultOutput ( )

getEmailSubject() 보호된 메소드

Get the e-mail subject line for output results.
protected getEmailSubject ( ) : string
리턴 string

getExpression() 공개 메소드

Get the Cron expression for the event.
public getExpression ( ) : string
리턴 string

getSummaryForDisplay() 공개 메소드

Get the summary of the event for display.
public getSummaryForDisplay ( ) : string
리턴 string

hourly() 공개 메소드

Schedule the event to run hourly.
public hourly ( )

isDue() 공개 메소드

Determine if the given event should run based on the Cron expression.
public isDue ( Application $app ) : boolean
$app yii\base\Application
리턴 boolean

mondays() 공개 메소드

Schedule the event to run only on Mondays.
public mondays ( )

monthly() 공개 메소드

Schedule the event to run monthly.
public monthly ( )

run() 공개 메소드

Run the given event.
public run ( Application $app )
$app yii\base\Application

runCommandInBackground() 보호된 메소드

Run the command in the background using exec.
protected runCommandInBackground ( Application $app )
$app yii\base\Application

runCommandInForeground() 보호된 메소드

Run the command in the foreground.
protected runCommandInForeground ( Application $app )
$app yii\base\Application

saturdays() 공개 메소드

Schedule the event to run only on Saturdays.
public saturdays ( )

sendOutputTo() 공개 메소드

Send the output of the command to a given location.
public sendOutputTo ( string $location )
$location string

skip() 공개 메소드

Register a callback to further filter the schedule.
public skip ( Closure $callback )
$callback Closure

spliceIntoPosition() 보호된 메소드

Splice the given value into the given position of the expression.
protected spliceIntoPosition ( integer $position, string $value ) : Event
$position integer
$value string
리턴 Event

sundays() 공개 메소드

Schedule the event to run only on Sundays.
public sundays ( )

then() 공개 메소드

Register a callback to be called after the operation.
public then ( Closure $callback )
$callback Closure

thenPing() 공개 메소드

Register a callback to the ping a given URL after the job runs.
public thenPing ( string $url )
$url string

thursdays() 공개 메소드

Schedule the event to run only on Thursdays.
public thursdays ( )

timezone() 공개 메소드

Set the timezone the date should be evaluated on.
public timezone ( DateTimeZone | string $timezone )
$timezone DateTimeZone | string

tuesdays() 공개 메소드

Schedule the event to run only on Tuesdays.
public tuesdays ( )

twiceDaily() 공개 메소드

Schedule the event to run twice daily.
public twiceDaily ( )

user() 공개 메소드

Set which user the command should run as.
public user ( string $user )
$user string

wednesdays() 공개 메소드

Schedule the event to run only on Wednesdays.
public wednesdays ( )

weekdays() 공개 메소드

Schedule the event to run only on weekdays.
public weekdays ( )

weekly() 공개 메소드

Schedule the event to run weekly.
public weekly ( )

weeklyOn() 공개 메소드

Schedule the event to run weekly on a given day and time.
public weeklyOn ( integer $day, string $time = '0:0' )
$day integer
$time string

when() 공개 메소드

Register a callback to further filter the schedule.
public when ( Closure $callback )
$callback Closure

yearly() 공개 메소드

Schedule the event to run yearly.
public yearly ( )

프로퍼티 상세

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

The array of callbacks to be run after the event is finished.
protected array $_afterCallbacks
리턴 array

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

The human readable description of the event.
protected string $_description
리턴 string

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

The cron expression representing the event's frequency.
protected string $_expression
리턴 string

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

The filter callback.
protected Closure $_filter
리턴 Closure

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

The location that output should be sent to.
protected string $_output
리턴 string

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

The reject callback.
protected Closure $_reject
리턴 Closure

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

The timezone the date should be evaluated on.
protected DateTimeZone|string $_timezone
리턴 DateTimeZone | string

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

The user the command should run as.
protected string $_user
리턴 string

$command 공개적으로 프로퍼티

Command string
public string $command
리턴 string