PHP Класс Crunz\Schedule

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$afterCallbacks array The array of callbacks to be run after all the event is finished.
$beforeCallbacks array The array of callbacks to be run before all the events are finished
$errorCallbacks array The array of callbacks to call in case of an error.
$events array All of the events on the schedule.

Открытые методы

Метод Описание
after ( Closure $callback ) Register a callback to be called after the operation.
afterCallbacks ( ) : array Return all registered after callbacks
before ( Closure $callback ) Register a callback to be called before the operation.
beforeCallbacks ( ) : array Return all registered before callbacks
dismissEvent ( integer $key ) Dismiss an event after it is finished
dueEvents ( ) : array Get all of the events on the schedule that are due.
errorCallbacks ( ) : array Return all registered error callbacks
events ( array $events = null ) : array Get or set the events of the schedule object
onError ( Closure $callback ) Register a callback to call in case of an error
pingBefore ( string $url ) Register a callback to ping a given URL before the job runs.
run ( string $command, array $parameters = [] ) : Event Add a new event to the schedule object.
then ( Closure $callback ) Register a callback to be called after the operation.
thenPing ( string $url ) Register a callback to ping a given URL after the job runs.

Защищенные методы

Метод Описание
compileParameters ( array $parameters ) : string Compile parameters for a command.
id ( ) : string Generate a unique task id

Описание методов

after() публичный Метод

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

afterCallbacks() публичный Метод

Return all registered after callbacks
public afterCallbacks ( ) : array
Результат array

before() публичный Метод

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

beforeCallbacks() публичный Метод

Return all registered before callbacks
public beforeCallbacks ( ) : array
Результат array

compileParameters() защищенный Метод

Compile parameters for a command.
protected compileParameters ( array $parameters ) : string
$parameters array
Результат string

dismissEvent() публичный Метод

Dismiss an event after it is finished
public dismissEvent ( integer $key )
$key integer

dueEvents() публичный Метод

Get all of the events on the schedule that are due.
public dueEvents ( ) : array
Результат array

errorCallbacks() публичный Метод

Return all registered error callbacks
public errorCallbacks ( ) : array
Результат array

events() публичный Метод

Get or set the events of the schedule object
public events ( array $events = null ) : array
$events array
Результат array

id() защищенный Метод

Generate a unique task id
protected id ( ) : string
Результат string

onError() публичный Метод

Register a callback to call in case of an error
public onError ( Closure $callback )
$callback Closure

pingBefore() публичный Метод

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

run() публичный Метод

Add a new event to the schedule object.
public run ( string $command, array $parameters = [] ) : Event
$command string
$parameters array
Результат Event

then() публичный Метод

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

thenPing() публичный Метод

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

Описание свойств

$afterCallbacks защищенное свойство

The array of callbacks to be run after all the event is finished.
protected array $afterCallbacks
Результат array

$beforeCallbacks защищенное свойство

The array of callbacks to be run before all the events are finished
protected array $beforeCallbacks
Результат array

$errorCallbacks защищенное свойство

The array of callbacks to call in case of an error.
protected array $errorCallbacks
Результат array

$events защищенное свойство

All of the events on the schedule.
protected array $events
Результат array