MediaWiki REL1_27
|
Various HTTP related functions. More...
Static Public Member Functions | |
static | get ( $url, $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'GET' ) | |
static | getProxy () |
Gets the relevant proxy from $wgHTTPProxy. | |
static | isLocalURL ( $url) |
Check if the URL can be served by localhost. | |
static | isValidURI ( $uri) |
Checks that the given URI is a valid one. | |
static | post ( $url, $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'POST' ) | |
static | request ( $method, $url, $options=[], $caller=__METHOD__) |
Perform an HTTP request. | |
static | userAgent () |
A standard user-agent we can use for external requests. | |
Static Public Attributes | |
static | $httpEngine = false |
Various HTTP related functions.
Definition at line 34 of file HttpFunctions.php.
|
static |
Simple wrapper for Http::request( 'GET' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Definition at line 100 of file HttpFunctions.php.
References $args, $options, request(), and wfWarn().
Referenced by MediaWiki\Site\MediaWikiPageNameNormalizer\normalizePageName().
|
static |
Gets the relevant proxy from $wgHTTPProxy.
Definition at line 201 of file HttpFunctions.php.
References $wgHTTPProxy, and global.
|
static |
Check if the URL can be served by localhost.
string | $url | Full url to check |
Definition at line 133 of file HttpFunctions.php.
References $i, $matches, $wgCommandLineMode, $wgLocalVirtualHosts, and global.
|
static |
Checks that the given URI is a valid one.
Hardcoding the protocols, because we only want protocols that both cURL and php support.
file:// should not be allowed here for security purpose (r67684)
string | $uri | URI to check for validity |
Definition at line 189 of file HttpFunctions.php.
|
static |
Simple wrapper for Http::request( 'POST' )
string | $url | |
array | $options | |
string | $caller | The method making this request, for profiling |
Definition at line 123 of file HttpFunctions.php.
|
static |
Perform an HTTP request.
string | $method | HTTP method. Usually GET/POST |
string | $url | Full URL to act on. If protocol-relative, will be expanded to an http:// URL |
array | $options | Options to pass to MWHttpRequest object. Possible keys for the array:
|
string | $caller | The method making this request, for profiling |
Definition at line 63 of file HttpFunctions.php.
|
static |
A standard user-agent we can use for external requests.
Definition at line 172 of file HttpFunctions.php.
References $wgVersion, and global.
|
static |
Definition at line 35 of file HttpFunctions.php.