MediaWiki
master
|
Various HTTP related functions. More...
Static Public Member Functions | |
static | get ($url, $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'GET' ) More... | |
static | getProxy () |
Gets the relevant proxy from $wgHTTPProxy. More... | |
static | isValidURI ($uri) |
Checks that the given URI is a valid one. More... | |
static | post ($url, $options=[], $caller=__METHOD__) |
Simple wrapper for Http::request( 'POST' ) More... | |
static | request ($method, $url, $options=[], $caller=__METHOD__) |
Perform an HTTP request. More... | |
static | userAgent () |
A standard user-agent we can use for external requests. More... | |
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 Installer\dirIsExecutable(), BenchHttpHttps\doRequest(), WikiRevision\downloadSource(), ImportSiteScripts\execute(), ExternalStoreHttp\fetchFromURL(), ImportSiteScripts\fetchScriptList(), ForeignDBFile\getDescriptionText(), File\getDescriptionText(), getFileCommentFromSourceWiki(), getFileUserFromSourceWiki(), and FindHooks\getHooksFromOnlineDocCategory().
|
static |
Gets the relevant proxy from $wgHTTPProxy.
Definition at line 160 of file HttpFunctions.php.
References $wgHTTPProxy, and global.
Referenced by MWHttpRequest\proxySetup(), and HttpTest\testGetProxy().
|
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 148 of file HttpFunctions.php.
Referenced by MWHttpRequest\__construct(), PhpHttpRequest\execute(), UploadFromUrl\fetchFile(), SideBarTest\initMessagesHref(), and HttpTest\testIsValidUri().
|
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.
References $options, and request().
Referenced by Pingback\postPingback().
|
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.
References $options, $req, $status, MWHttpRequest\factory(), and wfDebug().
Referenced by FileBackendTest\doTestGetFileHttpUrl(), get(), ImportStreamSource\newFromURL(), and post().
|
static |
A standard user-agent we can use for external requests.
Definition at line 131 of file HttpFunctions.php.
References $wgVersion, and global.
Referenced by MWHttpRequest\execute(), ForeignAPIRepo\getUserAgent(), and SquidPurgeClient\queuePurge().
|
static |
Definition at line 35 of file HttpFunctions.php.
Referenced by MWHttpRequest\factory(), and MWHttpRequestTester\factory().