MediaWiki master
MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack Class Reference

This class decouples DeferredUpdates's awareness of MediaWikiServices to ease unit testing. More...

Inherits MediaWiki\Deferred\DeferredUpdatesScopeStack.

Collaboration diagram for MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack:

Public Member Functions

 allowOpportunisticUpdates ()
 Whether DeferredUpdates::addUpdate() may run the update right away.
 
 onRunUpdateEnd (DeferrableUpdate $update)
 
 onRunUpdateFailed (DeferrableUpdate $update)
 
 onRunUpdateStart (DeferrableUpdate $update)
 
 queueDataUpdate (EnqueueableDataUpdate $update)
 Queue an EnqueueableDataUpdate as a job instead.
 
- Public Member Functions inherited from MediaWiki\Deferred\DeferredUpdatesScopeStack
 __construct ()
 
 ascend ()
 Pop the innermost scope from the stack.
 
 current ()
 
 descend ( $activeStage, DeferrableUpdate $update)
 Make a new child scope, push it onto the stack, and return it.
 
 getRecursiveDepth ()
 Get the depth of the scope stack below the root scope.
 

Detailed Description

This class decouples DeferredUpdates's awareness of MediaWikiServices to ease unit testing.

NOTE: As a process-level utility, it is important that MediaWikiServices::getInstance() is referenced explicitly each time, so as to not cache potentially stale references. For example after the Installer, or MediaWikiIntegrationTestCase, replace the service container.

Access: internal
For use by DeferredUpdates only
Since
1.41

Definition at line 36 of file DeferredUpdatesScopeMediaWikiStack.php.

Member Function Documentation

◆ allowOpportunisticUpdates()

MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::allowOpportunisticUpdates ( )

Whether DeferredUpdates::addUpdate() may run the update right away.

Returns
bool

Reimplemented from MediaWiki\Deferred\DeferredUpdatesScopeStack.

Definition at line 55 of file DeferredUpdatesScopeMediaWikiStack.php.

◆ onRunUpdateEnd()

MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::onRunUpdateEnd ( DeferrableUpdate $update)
Parameters
DeferrableUpdate$update

Reimplemented from MediaWiki\Deferred\DeferredUpdatesScopeStack.

Definition at line 121 of file DeferredUpdatesScopeMediaWikiStack.php.

◆ onRunUpdateFailed()

MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::onRunUpdateFailed ( DeferrableUpdate $update)
Parameters
DeferrableUpdate$update

Reimplemented from MediaWiki\Deferred\DeferredUpdatesScopeStack.

Definition at line 132 of file DeferredUpdatesScopeMediaWikiStack.php.

◆ onRunUpdateStart()

MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::onRunUpdateStart ( DeferrableUpdate $update)
Parameters
DeferrableUpdate$update

Reimplemented from MediaWiki\Deferred\DeferredUpdatesScopeStack.

Definition at line 76 of file DeferredUpdatesScopeMediaWikiStack.php.

◆ queueDataUpdate()

MediaWiki\Deferred\DeferredUpdatesScopeMediaWikiStack::queueDataUpdate ( EnqueueableDataUpdate $update)

Queue an EnqueueableDataUpdate as a job instead.

See also
JobQueueGroup::push
Parameters
EnqueueableDataUpdate$update

Reimplemented from MediaWiki\Deferred\DeferredUpdatesScopeStack.

Definition at line 70 of file DeferredUpdatesScopeMediaWikiStack.php.


The documentation for this class was generated from the following file: