MediaWiki REL1_37
|
DeferredUpdates helper class for managing DeferrableUpdate::doUpdate() nesting levels caused by nested calls to DeferredUpdates::doUpdates() More...
Public Member Functions | |
addUpdate (DeferrableUpdate $update, $stage) | |
Enqueue a deferred update within this scope using the specified "defer until" time. | |
clearPendingUpdates () | |
Cancel all pending updates within this scope. | |
consumeMatchingUpdates ( $stage, $class, callable $callback) | |
Remove pending updates of the specified stage/class and pass them to a callback. | |
getActiveUpdate () | |
Get the deferred update that owns this scope (root scope has none) | |
getPendingUpdates ( $stage) | |
Get pending updates within this scope with the given "defer until" stage. | |
pendingUpdatesCount () | |
Get the number of pending updates within this scope. | |
processUpdates ( $stage, callable $callback) | |
Iteratively, reassign unready pending updates to the parent scope (if applicable) and process the ready pending updates in stage-order with the callback, repeating the process until there is nothing left to do. | |
Static Public Member Functions | |
static | newChildScope ( $activeStage, DeferrableUpdate $update, DeferredUpdatesScope $parentScope) |
static | newRootScope () |
Private Member Functions | |
__construct ( $activeStage, ?DeferrableUpdate $update, ?DeferredUpdatesScope $parentScope) | |
processStageQueue ( $stage, $activeStage, callable $callback) | |
upmergeUnreadyUpdates ( $activeStage) | |
If this is a child scope, then reassign unready pending updates to the parent scope: | |
Private Attributes | |
int null | $activeStage |
Active processing stage in DeferredUpdates::STAGES (if any) | |
DeferrableUpdate null | $activeUpdate |
Deferred update that owns this scope (root scope has none) | |
DeferredUpdatesScope null | $parentScope |
Parent scope (root scope as none) | |
DeferrableUpdate[][] | $queueByStage |
Stage-ordered (stage => merge class or position => update) map. | |
DeferredUpdates helper class for managing DeferrableUpdate::doUpdate() nesting levels caused by nested calls to DeferredUpdates::doUpdates()
Definition at line 30 of file DeferredUpdatesScope.php.
|
private |
int | null | $activeStage | One of DeferredUpdates::STAGES or null |
DeferrableUpdate | null | $update | |
DeferredUpdatesScope | null | $parentScope |
Definition at line 45 of file DeferredUpdatesScope.php.
References $activeStage, and $parentScope.
DeferredUpdatesScope::addUpdate | ( | DeferrableUpdate | $update, |
$stage | |||
) |
Enqueue a deferred update within this scope using the specified "defer until" time.
DeferrableUpdate | $update | |
int | $stage | One of DeferredUpdates::STAGES |
Definition at line 92 of file DeferredUpdatesScope.php.
References $queue.
DeferredUpdatesScope::clearPendingUpdates | ( | ) |
Cancel all pending updates within this scope.
Definition at line 146 of file DeferredUpdatesScope.php.
DeferredUpdatesScope::consumeMatchingUpdates | ( | $stage, | |
$class, | |||
callable | $callback | ||
) |
Remove pending updates of the specified stage/class and pass them to a callback.
int | $stage | One of DeferredUpdates::STAGES or DeferredUpdates::ALL |
string | $class | Only take updates of this fully qualified class/interface name |
callable | $callback | Callback that takes DeferrableUpdate |
Definition at line 157 of file DeferredUpdatesScope.php.
References $queue.
DeferredUpdatesScope::getActiveUpdate | ( | ) |
Get the deferred update that owns this scope (root scope has none)
Definition at line 82 of file DeferredUpdatesScope.php.
References $activeUpdate.
DeferredUpdatesScope::getPendingUpdates | ( | $stage | ) |
Get pending updates within this scope with the given "defer until" stage.
int | $stage | One of DeferredUpdates::STAGES or DeferredUpdates::ALL |
Definition at line 132 of file DeferredUpdatesScope.php.
References $queue.
|
static |
int | $activeStage | The in-progress stage; one of DeferredUpdates::STAGES |
DeferrableUpdate | $update | The deferred update that owns this scope |
DeferredUpdatesScope | $parentScope | The parent scope of this scope |
Definition at line 69 of file DeferredUpdatesScope.php.
References $activeStage, and $parentScope.
Referenced by DeferredUpdatesScopeStack\descend().
|
static |
Definition at line 59 of file DeferredUpdatesScope.php.
Referenced by DeferredUpdatesScopeStack\__construct().
DeferredUpdatesScope::pendingUpdatesCount | ( | ) |
Get the number of pending updates within this scope.
Definition at line 122 of file DeferredUpdatesScope.php.
|
private |
int | $stage | One of DeferredUpdates::STAGES |
int | $activeStage | One of DeferredUpdates::STAGES |
callable | $callback | Processing function with arguments (update, effective stage) |
Definition at line 237 of file DeferredUpdatesScope.php.
References $activeStage.
Referenced by processUpdates().
DeferredUpdatesScope::processUpdates | ( | $stage, | |
callable | $callback | ||
) |
Iteratively, reassign unready pending updates to the parent scope (if applicable) and process the ready pending updates in stage-order with the callback, repeating the process until there is nothing left to do.
int | $stage | One of DeferredUpdates::STAGES or DeferredUpdates::ALL |
callable | $callback | Processing function with arguments (update, effective stage) |
Definition at line 184 of file DeferredUpdatesScope.php.
References $activeStage, processStageQueue(), and upmergeUnreadyUpdates().
|
private |
If this is a child scope, then reassign unready pending updates to the parent scope:
int | $activeStage | One of DeferredUpdates::STAGES |
Definition at line 211 of file DeferredUpdatesScope.php.
References $activeStage, and $queue.
Referenced by processUpdates().
|
private |
Active processing stage in DeferredUpdates::STAGES (if any)
Definition at line 36 of file DeferredUpdatesScope.php.
Referenced by __construct(), newChildScope(), processStageQueue(), processUpdates(), and upmergeUnreadyUpdates().
|
private |
Deferred update that owns this scope (root scope has none)
Definition at line 34 of file DeferredUpdatesScope.php.
Referenced by getActiveUpdate().
|
private |
Parent scope (root scope as none)
Definition at line 32 of file DeferredUpdatesScope.php.
Referenced by __construct(), and newChildScope().
|
private |
Stage-ordered (stage => merge class or position => update) map.
Definition at line 38 of file DeferredUpdatesScope.php.