MediaWiki  master
ApiContinuationManager Class Reference

This manages continuation state. More...

Collaboration diagram for ApiContinuationManager:

Public Member Functions

 __construct (ApiBase $module, array $allModules=[], array $generatedModules=[])
 
 addContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the continuation parameter for a module. More...
 
 addGeneratorContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the continuation parameter for the generator module. More...
 
 addGeneratorNonContinueParam (ApiBase $module, $paramName, $paramValue)
 Set the non-continuation parameter for the generator module. More...
 
 getContinuation ()
 Fetch continuation result data. More...
 
 getRawContinuation ()
 Fetch raw continuation data. More...
 
 getRawNonContinuation ()
 Fetch raw non-continuation data. More...
 
 getRunModules ()
 Get the list of modules that should actually be run. More...
 
 getSource ()
 Get the class that created this manager. More...
 
 isGeneratorDone ()
 
 setContinuationIntoResult (ApiResult $result)
 Store the continuation data into the result. More...
 

Private Attributes

ApiBase false[] $allModules = []
 
array[] $continuationData = []
 
string[] $generatedModules
 
array[] $generatorContinuationData = []
 
bool $generatorDone = false
 
array[] $generatorNonContinuationData = []
 
array $generatorParams = []
 
string $source
 

Detailed Description

This manages continuation state.

Since
1.25 this is no longer a subclass of ApiBase

Definition at line 26 of file ApiContinuationManager.php.

Constructor & Destructor Documentation

◆ __construct()

ApiContinuationManager::__construct ( ApiBase  $module,
array  $allModules = [],
array  $generatedModules = [] 
)
Parameters
ApiBase$moduleModule starting the continuation
ApiBase[]$allModulesContains ApiBase instances that will be executed
string[]$generatedModulesNames of modules that depend on the generator
Exceptions
ApiUsageException

Definition at line 53 of file ApiContinuationManager.php.

References $allModules, $generatedModules, ApiBase\getMain(), ContextSource\getRequest(), and ApiUsageException\newWithMessage().

Member Function Documentation

◆ addContinueParam()

ApiContinuationManager::addContinueParam ( ApiBase  $module,
  $paramName,
  $paramValue 
)

Set the continuation parameter for a module.

Parameters
ApiBase$module
string$paramName
string | array$paramValue
Exceptions
UnexpectedValueException

Definition at line 129 of file ApiContinuationManager.php.

References ApiBase\encodeParamName(), and ApiBase\getModuleName().

◆ addGeneratorContinueParam()

ApiContinuationManager::addGeneratorContinueParam ( ApiBase  $module,
  $paramName,
  $paramValue 
)

Set the continuation parameter for the generator module.

Parameters
ApiBase$module
string$paramName
int | string | array$paramValue

Definition at line 176 of file ApiContinuationManager.php.

References ApiBase\encodeParamName(), and ApiBase\getModuleName().

◆ addGeneratorNonContinueParam()

ApiContinuationManager::addGeneratorNonContinueParam ( ApiBase  $module,
  $paramName,
  $paramValue 
)

Set the non-continuation parameter for the generator module.

In case the generator isn't going to be continued, this sets the fields to return.

Since
1.28
Parameters
ApiBase$module
string$paramName
string | array$paramValue

Definition at line 161 of file ApiContinuationManager.php.

References ApiBase\encodeParamName(), and ApiBase\getModuleName().

◆ getContinuation()

ApiContinuationManager::getContinuation ( )

Fetch continuation result data.

Returns
array [ (array)$data, (bool)$batchcomplete ]

Definition at line 206 of file ApiContinuationManager.php.

References $continuationData, and $generatorParams.

Referenced by setContinuationIntoResult().

◆ getRawContinuation()

ApiContinuationManager::getRawContinuation ( )

Fetch raw continuation data.

Returns
array[]

Definition at line 189 of file ApiContinuationManager.php.

◆ getRawNonContinuation()

ApiContinuationManager::getRawNonContinuation ( )

Fetch raw non-continuation data.

Since
1.28
Returns
array[]

Definition at line 198 of file ApiContinuationManager.php.

References $generatorNonContinuationData.

◆ getRunModules()

ApiContinuationManager::getRunModules ( )

Get the list of modules that should actually be run.

Returns
ApiBase[]

Definition at line 118 of file ApiContinuationManager.php.

◆ getSource()

ApiContinuationManager::getSource ( )

Get the class that created this manager.

Returns
string

Definition at line 103 of file ApiContinuationManager.php.

References $source.

◆ isGeneratorDone()

ApiContinuationManager::isGeneratorDone ( )
Returns
bool

Definition at line 110 of file ApiContinuationManager.php.

References $generatorDone.

◆ setContinuationIntoResult()

ApiContinuationManager::setContinuationIntoResult ( ApiResult  $result)

Store the continuation data into the result.

Parameters
ApiResult$result

Definition at line 268 of file ApiContinuationManager.php.

References ApiResult\ADD_ON_TOP, ApiResult\addValue(), getContinuation(), and ApiResult\NO_SIZE_CHECK.

Member Data Documentation

◆ $allModules

ApiBase false [] ApiContinuationManager::$allModules = []
private

Definition at line 31 of file ApiContinuationManager.php.

Referenced by __construct().

◆ $continuationData

array [] ApiContinuationManager::$continuationData = []
private

Definition at line 36 of file ApiContinuationManager.php.

Referenced by getContinuation().

◆ $generatedModules

string [] ApiContinuationManager::$generatedModules
private

Definition at line 33 of file ApiContinuationManager.php.

Referenced by __construct().

◆ $generatorContinuationData

array [] ApiContinuationManager::$generatorContinuationData = []
private

Definition at line 38 of file ApiContinuationManager.php.

◆ $generatorDone

bool ApiContinuationManager::$generatorDone = false
private

Definition at line 45 of file ApiContinuationManager.php.

Referenced by isGeneratorDone().

◆ $generatorNonContinuationData

array [] ApiContinuationManager::$generatorNonContinuationData = []
private

Definition at line 40 of file ApiContinuationManager.php.

Referenced by getRawNonContinuation().

◆ $generatorParams

array ApiContinuationManager::$generatorParams = []
private

Definition at line 43 of file ApiContinuationManager.php.

Referenced by getContinuation().

◆ $source

string ApiContinuationManager::$source
private

Definition at line 28 of file ApiContinuationManager.php.

Referenced by getSource().


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