PHP Класс omnilight\scheduling\Event

Наследование: extends yii\base\Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$command string Command string

Защищенные свойства (Protected)

Свойство Тип Описание
$_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