Go to the documentation of this file.
49 if ( !$this->session ) {
50 $this->session = $this->
getApiMain()->getRequest()->getSession();
69 if ( $this->apiMain ) {
83 $fauxContext->setRequest( $fauxRequest );
87 $this->apiMain =
new ApiMain( $fauxContext,
true );
99 $this->
getApiMain()->getModuleManager()->addModule(
103 'class' => get_class( $module ),
104 'factory' =>
function () use ( $module ) {
126 foreach ( $params as $key => $value ) {
136 foreach ( $ex->
getStatusValue()->getErrorsByType(
'error' ) as $error ) {
144 'Unmapped action module error: ' . $ex->getMessage(),
149 $actionModuleResult =
$apiMain->
getResult()->getResultData(
null, [
'Strip' =>
'all' ] );
204 array $actionModuleResult,
239 [
'actionModuleErrorCode' => $msg->
getApiCode() ]
267 if ( is_array( $param ) ) {
268 foreach ( $param as
$type => $value ) {
269 if (
$type ===
'list' ) {
272 foreach ( $value as $v ) {
276 return new ListParam( ParamType::TEXT, $paramList );
getStatusValue()
Fetch the error status.
This is the main API class, used for both external and internal processing.
WebRequest clone which takes values from a provided array.
Exception used to abort API execution with an error.
getKey()
Returns the message key.
getApiCode()
Returns a machine-readable code for use by the API.
Interface for messages with machine-readable data for use by the API.
This abstract class implements many basic API functions, and is the base of all API classes.
getParams()
Returns the message parameters.
Extension of Message implementing IApiMessage @newable.
getResult()
Get the ApiResult object associated with current request.
Group all the pieces relevant to the context of a request into one instance @newable.
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
execute()
Execute api request.
static getMain()
Get the RequestContext object associated with the main request.
Allow programs to request this object from WebRequest::response() and handle all outputting (or lack ...