\ActionScheduler_DataController

Class ActionScheduler_DataController

The main plugin/initialization class for the data stores.

Responsible for hooking everything up with WordPress.

Summary

Methods
Properties
Constants
dependencies_met()
is_migration_complete()
mark_migration_complete()
mark_migration_incomplete()
set_store_class()
set_logger_class()
set_sleep_time()
set_free_ticks()
maybe_free_memory()
free_memory()
init()
instance()
No public properties found
DATASTORE_CLASS
LOGGER_CLASS
STATUS_FLAG
STATUS_COMPLETE
MIN_PHP_VERSION
No protected methods found
No protected properties found
N/A
No private methods found
$instance
$sleep_time
$free_ticks
N/A

Constants

DATASTORE_CLASS

DATASTORE_CLASS = 'ActionScheduler_DBStore'

Action data store class name.

LOGGER_CLASS

LOGGER_CLASS = 'ActionScheduler_DBLogger'

Logger data store class name.

STATUS_FLAG

STATUS_FLAG = 'action_scheduler_migration_status'

Migration status option name.

STATUS_COMPLETE

STATUS_COMPLETE = 'complete'

Migration status option value.

MIN_PHP_VERSION

MIN_PHP_VERSION = '5.5'

Migration minimum required PHP version.

Properties

$instance

$instance : \ActionScheduler_DataController

Instance.

Type

normal

$sleep_time

$sleep_time : int

Sleep time in seconds.

Type

normal

$free_ticks

$free_ticks : int

Tick count required for freeing memory.

Type

normal

Methods

dependencies_met()

dependencies_met() : bool

Get a flag indicating whether the migration environment dependencies are met.

Returns

bool

is_migration_complete()

is_migration_complete() : bool

Get a flag indicating whether the migration is complete.

Returns

bool —

Whether the flag has been set marking the migration as complete

mark_migration_complete()

mark_migration_complete() : mixed

Mark the migration as complete.

Returns

mixed

mark_migration_incomplete()

mark_migration_incomplete() : mixed

Unmark migration when a plugin is de-activated. Will not work in case of silent activation, for example in an update.

We do this to mitigate the bug of lost actions which happens if there was an AS 2.x to AS 3.x migration in the past, but that plugin is now deactivated and the site was running on AS 2.x again.

Returns

mixed

set_store_class()

set_store_class(string  $class) : string

Set the action store class name.

Parameters

string $class

Classname of the store class.

Returns

string

set_logger_class()

set_logger_class(string  $class) : string

Set the action logger class name.

Parameters

string $class

Classname of the logger class.

Returns

string

set_sleep_time()

set_sleep_time(int  $sleep_time) : mixed

Set the sleep time in seconds.

Parameters

int $sleep_time

The number of seconds to pause before resuming operation.

Returns

mixed

set_free_ticks()

set_free_ticks(int  $free_ticks) : mixed

Set the tick count required for freeing memory.

Parameters

int $free_ticks

The number of ticks to free memory on.

Returns

mixed

maybe_free_memory()

maybe_free_memory(int  $ticks) : mixed

Free memory if conditions are met.

Parameters

int $ticks

Current tick count.

Returns

mixed

free_memory()

free_memory() : mixed

Reduce memory footprint by clearing the database query and object caches.

Returns

mixed

init()

init() : mixed

Connect to table datastores if migration is complete.

Otherwise, proceed with the migration if the dependencies have been met.

Returns

mixed

instance()

instance() : mixed

Singleton factory.

Returns

mixed