HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //proc/self/cwd/wp-content/plugins/automatewoo/includes/Async_Events/Abstract_Async_Event.php
<?php

namespace AutomateWoo\Async_Events;

use AutomateWoo\ActionScheduler\ActionSchedulerInterface;

/**
 * Class Abstract_Async_Event
 *
 * @since 4.8.0
 */
abstract class Abstract_Async_Event {

	/**
	 * The unique name/ID of the event.
	 *
	 * @var string
	 */
	protected $event_name;

	/**
	 * Set any events that this event is dependant on.
	 *
	 * @var array
	 */
	protected $event_dependencies;

	/**
	 * @var ActionSchedulerInterface
	 */
	protected $action_scheduler;

	/**
	 * Init the event.
	 */
	abstract public function init();

	/**
	 * Abstract_Async_Event constructor.
	 *
	 * @param ActionSchedulerInterface $action_scheduler
	 */
	public function __construct( ActionSchedulerInterface $action_scheduler ) {
		$this->action_scheduler = $action_scheduler;
	}

	/**
	 * Get the event name.
	 *
	 * @return string
	 */
	public function get_event_name() {
		return $this->event_name;
	}

	/**
	 * Set the event name.
	 *
	 * @param string $event_name
	 */
	public function set_event_name( $event_name ) {
		$this->event_name = $event_name;
	}

	/**
	 * Get the events this event is dependant on.
	 *
	 * @return array
	 */
	public function get_event_dependencies() {
		return (array) $this->event_dependencies;
	}

	/**
	 * Set the events this event is dependant on.
	 *
	 * @deprecated in 5.2.0 because it's preferable for events to define their own dependencies.
	 *
	 * @param array|string $event_dependencies
	 */
	public function set_event_dependencies( $event_dependencies ) {
		wc_deprecated_function( __METHOD__, '5.2.0' );
		$this->event_dependencies = $event_dependencies;
	}

	/**
	 * Get the async event hook name.
	 *
	 * @since 5.2.0
	 *
	 * @return string
	 */
	public function get_hook_name(): string {
		return "automatewoo/async/{$this->get_event_name()}";
	}

	/**
	 * Create async event.
	 *
	 * Uses $this->get_hook_name() for the hook name.
	 *
	 * @param array $event_args The args for the event.
	 *
	 * @since 5.2.0
	 */
	protected function create_async_event( array $event_args ) {
		$this->action_scheduler->enqueue_async_action( $this->get_hook_name(), $event_args );
	}

}