PHP 클래스 Automattic\WP\Cron_Control\Events

상속: extends Singleton
파일 보기 프로젝트 열기: Automattic/vip-mu-plugins-public 1 사용 예제들

공개 메소드들

메소드 설명
get_event ( $timestamp, $action_hashed, $instance ) Find an event's data using its hashed representations
get_events ( ) List events pending for the current period
get_lock_key_for_event_action ( $event ) : string Turn the event action into a string that can be used with a lock
prepare_environment ( ) Prepare environment to run job
run_event ( $timestamp, $action, $instance, $force = false ) : array | WP_Error Execute a specific event

보호된 메소드들

메소드 설명
class_init ( ) Register hooks

비공개 메소드들

메소드 설명
action_has_callback_or_should_run_anyway ( $event ) : boolean Check that an event has a callback to run, and allow the check to be overridden Empty events are, by default, skipped and removed/rescheduled
can_run_event ( $event ) : boolean Are resources available to run this event?
do_lock_cleanup ( $event ) Free locks after event completes
prime_event_action_lock ( $event ) Prime the event-specific lock
reduce_queue ( $events ) : array Trim events queue down to the limit set by JOB_QUEUE_SIZE
reset_event_lock ( $event ) : boolean Frees the lock for an individual event
update_event_record ( $event ) Mark an event completed, and reschedule when requested

메소드 상세

class_init() 보호된 메소드

Register hooks
protected class_init ( )

get_event() 공개 메소드

The $instance argument is hashed for us by Core, while we hash the action to avoid information disclosure
public get_event ( $timestamp, $action_hashed, $instance )

get_events() 공개 메소드

List events pending for the current period
public get_events ( )

get_lock_key_for_event_action() 공개 메소드

Turn the event action into a string that can be used with a lock
public get_lock_key_for_event_action ( $event ) : string
$event array Event data
리턴 string

prepare_environment() 공개 메소드

Must run as early as possible, particularly before any client code is loaded This also runs before Core has parsed the request and set the \REST_REQUEST constant
public prepare_environment ( )

run_event() 공개 메소드

Execute a specific event
public run_event ( $timestamp, $action, $instance, $force = false ) : array | WP_Error
$timestamp int Unix timestamp
$action string md5 hash of the action used when the event is registered
$instance string md5 hash of the event's arguments array, which Core uses to index the `cron` option
$force bool Run event regardless of timestamp or lock status? eg, when executing jobs via wp-cli
리턴 array | WP_Error