|
MediaWiki
REL1_19
|
Various HTTP related functions. More...
Static Public Member Functions | |
| static | get ($url, $timeout= 'default', $options=array()) |
| Simple wrapper for Http::request( 'GET' ) | |
| 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=array()) |
| Simple wrapper for Http::request( 'POST' ) | |
| static | request ($method, $url, $options=array()) |
| 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 10 of file HttpFunctions.php.
| static Http::get | ( | $ | url, |
| $ | timeout = 'default', |
||
| $ | options = array() |
||
| ) | [static] |
Simple wrapper for Http::request( 'GET' )
| $url | |
| $timeout | string |
| $options | array |
Definition at line 66 of file HttpFunctions.php.
References $options, $url, and request().
Referenced by Installer\dirIsExecutable(), bench_HTTP_HTTPS\doRequest(), WikiRevision\downloadSource(), ImportSiteScripts\execute(), ExternalStoreHttp\fetchFromURL(), Parser\fetchScaryTemplateMaybeFromCache(), ImportSiteScripts\fetchScriptList(), File\getDescriptionText(), getFileCommentFromSourceWiki(), getFileUserFromSourceWiki(), and FindHooks\getHooksFromOnlineDoc().


| static Http::isLocalURL | ( | $ | url | ) | [static] |
Check if the URL can be served by localhost.
| $url | String: full url to check |
Definition at line 89 of file HttpFunctions.php.
References $matches, $url, and $wgCommandLineMode.
Referenced by MWHttpRequest\proxySetup().

| static Http::isValidURI | ( | $ | uri | ) | [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)
this is wildly inaccurate and fails to actually check most stuff
| $uri | Mixed: URI to check for validity |
Definition at line 144 of file HttpFunctions.php.
Referenced by MWHttpRequest\__construct(), PhpHttpRequest\execute(), UploadFromUrl\fetchFile(), UploadFromUrl\isValidRequest(), and HttpTest\testIsValidUri().

| static Http::post | ( | $ | url, |
| $ | options = array() |
||
| ) | [static] |
Simple wrapper for Http::request( 'POST' )
| $url | |
| $options | array |
Definition at line 79 of file HttpFunctions.php.
References $options, $url, and request().

| static Http::request | ( | $ | method, |
| $ | url, | ||
| $ | options = array() |
||
| ) | [static] |
Perform an HTTP request.
| $method | String: HTTP method. Usually GET/POST |
| $url | String: full URL to act on. If protocol-relative, will be expanded to an http:// URL |
| $options | Array: options to pass to MWHttpRequest object. Possible keys for the array:
|
Definition at line 36 of file HttpFunctions.php.
References $options, $url, MWHttpRequest\factory(), and wfDebug().
Referenced by get(), ImportStreamSource\newFromURL(), and post().


| static Http::userAgent | ( | ) | [static] |
A standard user-agent we can use for external requests.
Definition at line 127 of file HttpFunctions.php.
References $wgVersion.
Referenced by MWHttpRequest\execute(), ForeignAPIRepo\getUserAgent(), and SquidPurgeClient\queuePurge().

Http::$httpEngine = false [static] |
Definition at line 11 of file HttpFunctions.php.
Referenced by MWHttpRequest\factory().