MediaWiki REL1_35
CurlHttpRequest Class Reference

MWHttpRequest implemented using internal curl compiled into PHP. More...

Inheritance diagram for CurlHttpRequest:
Collaboration diagram for CurlHttpRequest:

Public Member Functions

 __construct ()
 
 canFollowRedirects ()
 
 execute ()
 
- Public Member Functions inherited from MWHttpRequest
 __construct ( $url, array $options=[], $caller=__METHOD__, Profiler $profiler=null)
 
 getContent ()
 Get the body, or content, of the response to the request.
 
 getCookieJar ()
 Returns the cookie jar in use.
 
 getFinalUrl ()
 Returns the final URL after all redirections.
 
 getResponseHeader ( $header)
 Returns the value of the given response header.
 
 getResponseHeaders ()
 Returns an associative array of response headers after the request has been executed.
 
 getStatus ()
 Get the integer value of the HTTP status code (e.g.
 
 isRedirect ()
 Returns true if the last status code was a redirect.
 
 read ( $fh, $content)
 A generic callback to read the body of the response from a remote server.
 
 setCallback ( $callback)
 Set a read callback to accept data read from the HTTP request.
 
 setCookie ( $name, $value, array $attr=[])
 Sets a cookie.
 
 setCookieJar (CookieJar $jar)
 Tells the MWHttpRequest object to use this pre-loaded CookieJar.
 
 setData (array $args)
 Set the parameters of the request.
 
 setHeader ( $name, $value)
 Set an arbitrary header.
 
 setLogger (LoggerInterface $logger)
 
 setOriginalRequest ( $originalRequest)
 Set information about the original request.
 
 setUserAgent ( $UA)
 Set the user agent.
 

Public Attributes

const SUPPORTS_FILE_POSTS = true
 
- Public Attributes inherited from MWHttpRequest
const SUPPORTS_FILE_POSTS = false
 

Protected Member Functions

 readHeader ( $fh, $content)
 
- Protected Member Functions inherited from MWHttpRequest
 doSetCallback ( $callback)
 Worker function for setting callbacks.
 
 getHeaderList ()
 Get an array of the headers.
 
 parseCookies ()
 Parse the cookies in the response headers and store them in the cookie jar.
 
 parseHeader ()
 Parses the headers, including the HTTP status code and any Set-Cookie headers.
 
 prepare ()
 
 proxySetup ()
 Take care of setting up the proxy (do nothing if "noProxy" is set)
 
 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 (1-299) or a redirect (300-399).
 

Protected Attributes

 $curlOptions = []
 
 $headerText = ""
 
- Protected Attributes inherited from MWHttpRequest
 $caInfo = null
 
callable $callback
 
 $connectTimeout
 
 $content
 
CookieJar $cookieJar
 
 $followRedirects = false
 
 $headerList = []
 
 $headersOnly = null
 
LoggerInterface $logger
 
 $maxRedirects = 5
 
 $method = "GET"
 
 $noProxy = false
 
 $parsedUrl
 
 $postData = null
 
string $profileName
 
Profiler $profiler
 
 $proxy = null
 
array $reqHeaders = []
 
string[][] $respHeaders = []
 
 $respStatus = "200 Ok"
 
 $respVersion = "0.9"
 
 $sslVerifyCert = true
 
 $sslVerifyHost = true
 
StatusValue $status
 
int string $timeout = 'default'
 
 $url
 

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()
 
static factory ( $url, array $options=null, $caller=__METHOD__)
 Generate a new request object.
 
static isValidURI ( $uri)
 Check that the given URI is a valid one.
 

Detailed Description

MWHttpRequest implemented using internal curl compiled into PHP.

Definition at line 24 of file CurlHttpRequest.php.

Constructor & Destructor Documentation

◆ __construct()

CurlHttpRequest::__construct ( )

Definition at line 34 of file CurlHttpRequest.php.

Member Function Documentation

◆ canFollowRedirects()

CurlHttpRequest::canFollowRedirects ( )
Returns
bool

Reimplemented from MWHttpRequest.

Definition at line 154 of file CurlHttpRequest.php.

Referenced by execute().

◆ execute()

CurlHttpRequest::execute ( )

◆ readHeader()

CurlHttpRequest::readHeader (   $fh,
  $content 
)
protected
Parameters
resource$fh
string$content
Returns
int

Definition at line 48 of file CurlHttpRequest.php.

References $content.

Member Data Documentation

◆ $curlOptions

CurlHttpRequest::$curlOptions = []
protected

Definition at line 27 of file CurlHttpRequest.php.

◆ $headerText

CurlHttpRequest::$headerText = ""
protected

Definition at line 28 of file CurlHttpRequest.php.

◆ SUPPORTS_FILE_POSTS

const CurlHttpRequest::SUPPORTS_FILE_POSTS = true

Definition at line 25 of file CurlHttpRequest.php.


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