PHP 클래스 Crunz\Event

파일 보기 프로젝트 열기: lavary/crunz 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$description string The human readable description of the event.
$output string The location that output should be sent to.
$outputStream string Event generated output
$preventOverlapping boolean Indicates if the command should not overlap itself.
$shouldAppendOutput boolean Indicates whether output should be appended.

보호된 프로퍼티들

프로퍼티 타입 설명
$afterCallbacks array The array of callbacks to be run after the event is finished.
$beforeCallbacks array The array of callbacks to be run before the event is started.
$command string The command string.
$cwd string Current working directory
$expression string The cron expression representing the event's frequency.
$fieldsPosition array Position of cron fields
$filters array The array of filter callbacks.
$id string The event's unique identifier
$process Symfony\Component\Process\Process Process that runs the event
$rejects array The array of reject callbacks.
$timezone DateTimeZone | string The timezone the date should be evaluated on.
$user string The user the command should run as.

공개 메소드들

메소드 설명
__call ( string $methodName, array $params ) Handling dynamic frequency methods
__construct ( $id, string $command ) : void Create a new event instance.
after ( Closure $callback ) Register a callback to be called after the operation.
afterCallbacks ( ) : array Return all registered after callbacks
appendOutputTo ( string $location ) Append the output of the command to a given location.
at ( string $time ) Schedule the command at a given time.
before ( Closure $callback ) Register a callback to be called before the operation.
beforeCallbacks ( ) : array Return all registered before callbacks
between ( $from, $to ) Set Working period
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).
dayOfMonth ( mixed $value ) Set hour for the cron job
dayOfWeek ( mixed $value ) Set hour for the cron job
days ( mixed $days ) Set the days of the week the command should run on.
description ( string $description ) Set the human-friendly description of the event.
every ( string $unit = null, string $value = null ) Another way to the frequency of the cron job
filtersPass ( ) : boolean Determine if the filters pass for the event.
fridays ( ) Schedule the event to run only on Fridays.
from ( string $datetime ) Check if event should be on
getCommand ( ) : string Return the event's command
getCommandForDisplay ( ) : string Get the command for display
getExpression ( ) : string Get the Cron expression for the event.
getId ( ) : string Return the event's command
getOutputStream ( ) : string Return event's full output
getProcess ( ) : Process Return the event's process
getSummaryForDisplay ( ) : string Get the summary of the event for display.
getWorkingDirectory ( ) : string Return the current working directory
hour ( mixed $value ) Set hour for the cron job
hourly ( ) Schedule the event to run hourly.
in ( string $directory ) Change the current working directory.
isClosure ( ) : boolean Determine whether the passed value is a closure ot not.
isDue ( ) : boolean Determine if the given event should run based on the Cron expression.
isLocked ( ) : boolean Check if another instance of the event is still running
lastPid ( ) : integer Get the last process Id of the event
lockFile ( ) : string Get the lock file path for the task
minute ( mixed $value ) Set minute for the cron job
mondays ( ) Schedule the event to run only on Mondays.
month ( mixed $value ) Set hour for the cron job
monthly ( ) Schedule the event to run monthly.
name ( string $description ) Set the human-friendly description of the event.
nullOutput ( ) : boolean Determine if the event's output is sent to null.
on ( string $date ) Schedule the event to run on a certain date
pingBefore ( string $url ) Register a callback to ping a given URL before the job runs.
preventOverlapping ( ) Do not allow the event to overlap each other.
quarterly ( ) Schedule the event to run quarterly.
saturdays ( ) Schedule the event to run only on Saturdays.
sendOutputTo ( string $location, boolean $append = false ) Send the output of the command to a given location.
setCommand ( string $command ) Set the event's command
setProcess ( Process $process = null ) Set the event's process
skip ( Closure $callback ) Register a callback to further filter the schedule.
start ( ) : integer Start the event execution
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 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.
to ( string $datetime ) Check if event should be off
tuesdays ( ) Schedule the event to run only on Tuesdays.
twiceDaily ( integer $first = 1, integer $second = 13 ) 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.

보호된 메소드들

메소드 설명
applyMask ( string $unit ) : string Mask a cron expression
expressionPasses ( ) : boolean Determine if the Cron expression passes.
getDefaultOutput ( ) : string Get the default output depending on the OS.
lock ( ) : string Lock the event
notYet ( $datetime ) : boolean Check if time hasn't arrived
past ( $datetime ) : boolean Check if the time has passed
serializeClosure ( string $closure ) : string Convert closure to an executable command
spliceIntoPosition ( integer $position, string $value ) Splice the given value into the given position of the expression.
sudo ( string $user ) : string Add sudo to the command

메소드 상세

__call() 공개 메소드

Handling dynamic frequency methods
public __call ( string $methodName, array $params )
$methodName string
$params array

__construct() 공개 메소드

Create a new event instance.
public __construct ( $id, string $command ) : void
$command string
리턴 void

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

appendOutputTo() 공개 메소드

Append the output of the command to a given location.
public appendOutputTo ( string $location )
$location string

applyMask() 보호된 메소드

Mask a cron expression
protected applyMask ( string $unit ) : string
$unit string
리턴 string

at() 공개 메소드

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

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

between() 공개 메소드

Set Working period
public between ( $from, $to )

buildCommand() 공개 메소드

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

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

dayOfMonth() 공개 메소드

Set hour for the cron job
public dayOfMonth ( mixed $value )
$value mixed

dayOfWeek() 공개 메소드

Set hour for the cron job
public dayOfWeek ( mixed $value )
$value mixed

days() 공개 메소드

Set the days of the week the command should run on.
public days ( mixed $days )
$days mixed

description() 공개 메소드

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

every() 공개 메소드

Another way to the frequency of the cron job
public every ( string $unit = null, string $value = null )
$unit string
$value string

expressionPasses() 보호된 메소드

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

filtersPass() 공개 메소드

Determine if the filters pass for the event.
public filtersPass ( ) : boolean
리턴 boolean

fridays() 공개 메소드

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

from() 공개 메소드

Check if event should be on
public from ( string $datetime )
$datetime string

getCommand() 공개 메소드

Return the event's command
public getCommand ( ) : string
리턴 string

getCommandForDisplay() 공개 메소드

Get the command for display
public getCommandForDisplay ( ) : string
리턴 string

getDefaultOutput() 보호된 메소드

Get the default output depending on the OS.
protected getDefaultOutput ( ) : string
리턴 string

getExpression() 공개 메소드

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

getId() 공개 메소드

Return the event's command
public getId ( ) : string
리턴 string

getOutputStream() 공개 메소드

Return event's full output
public getOutputStream ( ) : string
리턴 string

getProcess() 공개 메소드

Return the event's process
public getProcess ( ) : Process
리턴 Symfony\Component\Process\Process $process

getSummaryForDisplay() 공개 메소드

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

getWorkingDirectory() 공개 메소드

Return the current working directory
public getWorkingDirectory ( ) : string
리턴 string

hour() 공개 메소드

Set hour for the cron job
public hour ( mixed $value )
$value mixed

hourly() 공개 메소드

Schedule the event to run hourly.
public hourly ( )

in() 공개 메소드

Change the current working directory.
public in ( string $directory )
$directory string

isClosure() 공개 메소드

Determine whether the passed value is a closure ot not.
public isClosure ( ) : boolean
리턴 boolean

isDue() 공개 메소드

Determine if the given event should run based on the Cron expression.
public isDue ( ) : boolean
리턴 boolean

isLocked() 공개 메소드

Check if another instance of the event is still running
public isLocked ( ) : boolean
리턴 boolean

lastPid() 공개 메소드

Get the last process Id of the event
public lastPid ( ) : integer
리턴 integer

lock() 보호된 메소드

Lock the event
protected lock ( ) : string
리턴 string

lockFile() 공개 메소드

Get the lock file path for the task
public lockFile ( ) : string
리턴 string

minute() 공개 메소드

Set minute for the cron job
public minute ( mixed $value )
$value mixed

mondays() 공개 메소드

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

month() 공개 메소드

Set hour for the cron job
public month ( mixed $value )
$value mixed

monthly() 공개 메소드

Schedule the event to run monthly.
public monthly ( )

name() 공개 메소드

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

notYet() 보호된 메소드

Check if time hasn't arrived
protected notYet ( $datetime ) : boolean
리턴 boolean

nullOutput() 공개 메소드

Determine if the event's output is sent to null.
public nullOutput ( ) : boolean
리턴 boolean

on() 공개 메소드

Schedule the event to run on a certain date
public on ( string $date )
$date string

past() 보호된 메소드

Check if the time has passed
protected past ( $datetime ) : boolean
리턴 boolean

pingBefore() 공개 메소드

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

preventOverlapping() 공개 메소드

Do not allow the event to overlap each other.
public preventOverlapping ( )

quarterly() 공개 메소드

Schedule the event to run quarterly.
public quarterly ( )

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, boolean $append = false )
$location string
$append boolean

serializeClosure() 보호된 메소드

Convert closure to an executable command
protected serializeClosure ( string $closure ) : string
$closure string
리턴 string

setCommand() 공개 메소드

Set the event's command
public setCommand ( string $command )
$command string

setProcess() 공개 메소드

Set the event's process
public setProcess ( Process $process = null )
$process Symfony\Component\Process\Process

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 )
$position integer
$value string

start() 공개 메소드

Start the event execution
public start ( ) : integer
리턴 integer

sudo() 보호된 메소드

Add sudo to the command
protected sudo ( string $user ) : string
$user string
리턴 string

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 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

to() 공개 메소드

Check if event should be off
public to ( string $datetime )
$datetime string

tuesdays() 공개 메소드

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

twiceDaily() 공개 메소드

Schedule the event to run twice daily.
public twiceDaily ( integer $first = 1, integer $second = 13 )
$first integer
$second integer

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

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

The array of callbacks to be run before the event is started.
protected array $beforeCallbacks
리턴 array

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

The command string.
protected string $command
리턴 string

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

Current working directory
protected string $cwd
리턴 string

$description 공개적으로 프로퍼티

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

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

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

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

Position of cron fields
protected array $fieldsPosition
리턴 array

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

The array of filter callbacks.
protected array $filters
리턴 array

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

The event's unique identifier
protected string $id
리턴 string

$output 공개적으로 프로퍼티

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

$outputStream 공개적으로 프로퍼티

Event generated output
public string $outputStream
리턴 string

$preventOverlapping 공개적으로 프로퍼티

Indicates if the command should not overlap itself.
public bool $preventOverlapping
리턴 boolean

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

Process that runs the event
protected Process,Symfony\Component\Process $process
리턴 Symfony\Component\Process\Process

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

The array of reject callbacks.
protected array $rejects
리턴 array

$shouldAppendOutput 공개적으로 프로퍼티

Indicates whether output should be appended.
public bool $shouldAppendOutput
리턴 boolean

$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