MediaWiki
1.28.0
|
Public Member Functions | |
errorHandler ($errno, $errstr) | |
Custom error handler for dealing with fopen() errors. More... | |
execute () | |
Public Member Functions inherited from MWHttpRequest | |
canFollowRedirects () | |
Returns true if the backend can follow redirects. More... | |
execute () | |
Take care of whatever is necessary to perform the URI request. More... | |
getContent () | |
Get the body, or content, of the response to the request. More... | |
getCookieJar () | |
Returns the cookie jar in use. More... | |
getFinalUrl () | |
Returns the final URL after all redirections. More... | |
getHeaderList () | |
Get an array of the headers. More... | |
getResponseHeader ($header) | |
Returns the value of the given response header. More... | |
getResponseHeaders () | |
Returns an associative array of response headers after the request has been executed. More... | |
getStatus () | |
Get the integer value of the HTTP status code (e.g. More... | |
isRedirect () | |
Returns true if the last status code was a redirect. More... | |
proxySetup () | |
Take care of setting up the proxy (do nothing if "noProxy" is set) More... | |
read ($fh, $content) | |
A generic callback to read the body of the response from a remote server. More... | |
setCallback ($callback) | |
Set a read callback to accept data read from the HTTP request. More... | |
setCookie ($name, $value=null, $attr=null) | |
Sets a cookie. More... | |
setCookieJar ($jar) | |
Tells the MWHttpRequest object to use this pre-loaded CookieJar. More... | |
setData ($args) | |
Set the parameters of the request. More... | |
setHeader ($name, $value) | |
Set an arbitrary header. More... | |
setLogger (LoggerInterface $logger) | |
setUserAgent ($UA) | |
Set the user agent. More... | |
Protected Member Functions | |
getCertOptions () | |
Returns an array with a 'capath' or 'cafile' key that is suitable to be merged into the 'ssl' sub-array of a stream context options array. More... | |
urlToTcp ($url) | |
Protected Member Functions inherited from MWHttpRequest | |
__construct ($url, $options=[], $caller=__METHOD__, $profiler=null) | |
parseCookies () | |
Parse the cookies in the response headers and store them in the cookie jar. More... | |
parseHeader () | |
Parses the headers, including the HTTP status code and any Set-Cookie headers. More... | |
setStatus () | |
Sets HTTPRequest status member to a fatal value with the error message if the returned integer value of the status code was not successful (< 300) or a redirect (>=300 and < 400). More... | |
Private Attributes | |
$fopenErrors = [] | |
Additional Inherited Members | |
Static Public Member Functions inherited from MWHttpRequest | |
static | canMakeRequests () |
Simple function to test if we can make any sort of requests at all, using cURL or fopen() More... | |
static | factory ($url, $options=null, $caller=__METHOD__) |
Generate a new request object. More... | |
Public Attributes inherited from MWHttpRequest | |
$logger | |
$status | |
const | SUPPORTS_FILE_POSTS = false |
Protected Attributes inherited from MWHttpRequest | |
$caInfo = null | |
$callback | |
$content | |
CookieJar | $cookieJar |
$followRedirects = false | |
$headerList = [] | |
$headersOnly = null | |
$maxRedirects = 5 | |
$method = "GET" | |
$noProxy = false | |
$parsedUrl | |
$postData = null | |
string | $profileName |
Profiler | $profiler |
$proxy = null | |
$reqHeaders = [] | |
$respHeaders = [] | |
$respStatus = "200 Ok" | |
$respVersion = "0.9" | |
$sslVerifyCert = true | |
$sslVerifyHost = true | |
$timeout = 'default' | |
$url | |
LoggerInterface | |
Definition at line 21 of file PhpHttpRequest.php.
PhpHttpRequest::errorHandler | ( | $errno, | |
$errstr | |||
) |
Custom error handler for dealing with fopen() errors.
fopen() tends to fire multiple errors in succession, and the last one is completely useless (something like "fopen: failed to open stream") so normal methods of handling errors programmatically like get_last_error() don't work.
Definition at line 91 of file PhpHttpRequest.php.
PhpHttpRequest::execute | ( | ) |
Definition at line 96 of file PhpHttpRequest.php.
References $context, MWHttpRequest\$method, $options, MWHttpRequest\$postData, MWHttpRequest\$sslVerifyCert, MWHttpRequest\$status, MWHttpRequest\$timeout, MWHttpRequest\$url, execute(), getCertOptions(), MWHttpRequest\getHeaderList(), MWHttpRequest\getResponseHeader(), MWHttpRequest\isRedirect(), Http\isValidURI(), MWHttpRequest\parseHeader(), MWHttpRequest\setStatus(), urlToTcp(), and wfArrayToCgi().
|
protected |
Returns an array with a 'capath' or 'cafile' key that is suitable to be merged into the 'ssl' sub-array of a stream context options array.
Uses the 'caInfo' option of the class if it is provided, otherwise uses the system default CA bundle if PHP supports that, or searches a few standard locations.
DomainException |
Definition at line 44 of file PhpHttpRequest.php.
References MWHttpRequest\$caInfo, as, and Debian.
Referenced by execute().
|
protected |
string | $url |
Definition at line 29 of file PhpHttpRequest.php.
References MWHttpRequest\$parsedUrl, and MWHttpRequest\$url.
Referenced by execute().
|
private |
Definition at line 23 of file PhpHttpRequest.php.