MediaWiki REL1_31
|
Class to handle concurrent HTTP requests. More...
Public Member Functions | |
__construct (array $options) | |
__destruct () | |
run (array $req, array $opts=[]) | |
Execute an HTTP(S) request. | |
runMulti (array $reqs, array $opts=[]) | |
Execute a set of HTTP(S) requests concurrently. | |
setLogger (LoggerInterface $logger) | |
Register a logger. | |
Protected Member Functions | |
getCurlHandle (array &$req, array $opts=[]) | |
getCurlMulti () | |
Protected Attributes | |
string null | $caBundlePath |
SSL certificates path. | |
int | $connTimeout = 10 |
LoggerInterface | $logger |
int | $maxConnsPerHost = 50 |
resource | $multiHandle = null |
string null | $proxy |
proxy | |
int | $reqTimeout = 300 |
bool | $usePipelining = false |
string | $userAgent = 'wikimedia/multi-http-client v1.0' |
Class to handle concurrent HTTP requests.
HTTP request maps are arrays that use the following format:
Definition at line 48 of file MultiHttpClient.php.
MultiHttpClient::__construct | ( | array | $options | ) |
array | $options |
|
Exception |
Definition at line 78 of file MultiHttpClient.php.
References $options.
MultiHttpClient::__destruct | ( | ) |
Definition at line 440 of file MultiHttpClient.php.
|
protected |
array | &$req | HTTP request map |
array | $opts |
|
Exception |
Definition at line 285 of file MultiHttpClient.php.
References $connTimeout, $header, $matches, $proxy, $query, $req, $reqTimeout, $userAgent, $value, and list.
Referenced by runMulti().
|
protected |
Exception |
Definition at line 417 of file MultiHttpClient.php.
References $multiHandle.
Referenced by runMulti().
MultiHttpClient::run | ( | array | $req, |
array | $opts = [] ) |
Execute an HTTP(S) request.
This method returns a response map of:
array | $req | HTTP request array |
array | $opts |
Definition at line 118 of file MultiHttpClient.php.
References runMulti().
MultiHttpClient::runMulti | ( | array | $reqs, |
array | $opts = [] ) |
Execute a set of HTTP(S) requests concurrently.
The maps are returned by this method with the 'response' field set to a map of:
array | $reqs | Map of HTTP request arrays |
array | $opts |
|
Exception |
Definition at line 148 of file MultiHttpClient.php.
References $batch, $req, $value, getCurlHandle(), and getCurlMulti().
Referenced by run().
MultiHttpClient::setLogger | ( | LoggerInterface | $logger | ) |
Register a logger.
LoggerInterface | $logger |
Definition at line 436 of file MultiHttpClient.php.
References $logger.
|
protected |
SSL certificates path.
Definition at line 52 of file MultiHttpClient.php.
|
protected |
Definition at line 54 of file MultiHttpClient.php.
Referenced by getCurlHandle().
|
protected |
Definition at line 66 of file MultiHttpClient.php.
Referenced by setLogger().
|
protected |
Definition at line 60 of file MultiHttpClient.php.
|
protected |
Definition at line 50 of file MultiHttpClient.php.
Referenced by getCurlMulti().
|
protected |
|
protected |
Definition at line 56 of file MultiHttpClient.php.
Referenced by getCurlHandle().
|
protected |
Definition at line 58 of file MultiHttpClient.php.
|
protected |
Definition at line 64 of file MultiHttpClient.php.
Referenced by getCurlHandle().