MediaWiki master
ExternalStoreHttp.php
Go to the documentation of this file.
1<?php
8
9use LogicException;
11
23 public function fetchFromURL( $url ) {
24 return MediaWikiServices::getInstance()->getHttpRequestFactory()->
25 get( $url, [], __METHOD__ );
26 }
27
29 public function store( $location, $data ) {
30 // @phan-suppress-previous-line PhanPluginNeverReturnMethod
31 throw new LogicException( "ExternalStoreHttp is read-only and does not support store()." );
32 }
33
35 public function isReadOnly( $location ) {
36 return true;
37 }
38}
39
41class_alias( ExternalStoreHttp::class, 'ExternalStoreHttp' );
External storage using HTTP requests.
isReadOnly( $location)
Check if a given location is read-only.bool Whether this location is read-only 1.31
store( $location, $data)
Insert a data item into a given location.string|bool The URL of the stored data item,...
fetchFromURL( $url)
Fetch data from given external store URL.string|bool The text stored or false on error
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.