plugin updates

This commit is contained in:
Tony Volpe
2024-11-15 13:53:04 -05:00
parent 1293d604ca
commit 0238f0c4ca
2009 changed files with 163492 additions and 89543 deletions

View File

@@ -4,10 +4,13 @@
* Class ActionScheduler_Action
*/
class ActionScheduler_Action {
/** @var string */
protected $hook = '';
/** @var array<string, mixed> */
protected $args = array();
/** @var ActionScheduler_Schedule */
protected $schedule = NULL;
/** @var string */
protected $group = '';
/**
@@ -23,6 +26,14 @@ class ActionScheduler_Action {
*/
protected $priority = 10;
/**
* Construct.
*
* @param string $hook Action's hook.
* @param mixed[] $args Action's arguments.
* @param null|ActionScheduler_Schedule $schedule Action's schedule.
* @param string $group Action's group.
*/
public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' ) {
$schedule = empty( $schedule ) ? new ActionScheduler_NullSchedule() : $schedule;
$this->set_hook($hook);
@@ -57,16 +68,26 @@ class ActionScheduler_Action {
}
/**
* @param string $hook
* Set action's hook.
*
* @param string $hook Action's hook.
*/
protected function set_hook( $hook ) {
$this->hook = $hook;
}
/**
* Get action's hook.
*/
public function get_hook() {
return $this->hook;
}
/**
* Set action's schedule.
*
* @param ActionScheduler_Schedule $schedule Action's schedule.
*/
protected function set_schedule( ActionScheduler_Schedule $schedule ) {
$this->schedule = $schedule;
}
@@ -78,16 +99,26 @@ class ActionScheduler_Action {
return $this->schedule;
}
/**
* Set action's args.
*
* @param mixed[] $args Action's arguments.
*/
protected function set_args( array $args ) {
$this->args = $args;
}
/**
* Get action's args.
*/
public function get_args() {
return $this->args;
}
/**
* @param string $group
* Section action's group.
*
* @param string $group Action's group.
*/
protected function set_group( $group ) {
$this->group = $group;

View File

@@ -9,10 +9,12 @@
class ActionScheduler_CanceledAction extends ActionScheduler_FinishedAction {
/**
* @param string $hook
* @param array $args
* @param ActionScheduler_Schedule $schedule
* @param string $group
* Construct.
*
* @param string $hook Action's hook.
* @param array $args Action's arguments.
* @param null|ActionScheduler_Schedule $schedule Action's schedule.
* @param string $group Action's group.
*/
public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
parent::__construct( $hook, $args, $schedule, $group );

View File

@@ -5,12 +5,17 @@
*/
class ActionScheduler_FinishedAction extends ActionScheduler_Action {
/**
* Execute action.
*/
public function execute() {
// don't execute
// don't execute.
}
/**
* Get finished state.
*/
public function is_finished() {
return TRUE;
}
}

View File

@@ -5,12 +5,21 @@
*/
class ActionScheduler_NullAction extends ActionScheduler_Action {
/**
* Construct.
*
* @param string $hook Action hook.
* @param mixed[] $args Action arguments.
* @param null|ActionScheduler_Schedule $schedule Action schedule.
*/
public function __construct( $hook = '', array $args = array(), ActionScheduler_Schedule $schedule = NULL ) {
$this->set_schedule( new ActionScheduler_NullSchedule() );
}
/**
* Execute action.
*/
public function execute() {
// don't execute
// don't execute.
}
}