Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Config\Api\ApiHelper Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\Config\Api\ApiHelper:

Public Member Functions

 __construct (array $opts)
 
 makeRequest (array $params)
 Make an API request.
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Config\Api\ApiHelper::__construct ( array $opts)
Parameters
array$opts
  • apiEndpoint: (string) URL for api.php. Required.
  • apiTimeout: (int) Timeout, in sections. Default 60.
  • userAgent: (string) User agent prefix.
  • cacheDir: (string) If present, looks aside to the specified directory for a cached response before making a network request.
  • writeToCache: (bool|string) If present and truthy, writes successful network requests to cacheDir so they can be reused. If set to the string 'pretty', prettifies the JSON returned before writing it.

Member Function Documentation

◆ makeRequest()

Wikimedia\Parsoid\Config\Api\ApiHelper::makeRequest ( array $params)

Make an API request.

Parameters
array$paramsAPI parameters
Returns
array API response data

Reimplemented in Wikimedia\Parsoid\ParserTests\MockApiHelper.


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