MediaWiki master
MediaWiki\ExternalStore\ExternalStoreMedium Class Reference

Base class for external storage. More...

Inherits LoggerAwareInterface.

Inherited by MediaWiki\ExternalStore\ExternalStoreDB, MediaWiki\ExternalStore\ExternalStoreHttp, MediaWiki\ExternalStore\ExternalStoreMemory, and MediaWiki\ExternalStore\ExternalStoreMwstore.

Collaboration diagram for MediaWiki\ExternalStore\ExternalStoreMedium:

Public Member Functions

 __construct (array $params)
 
 batchFetchFromURLs (array $urls)
 Fetch data from given external store URLs.
 
 fetchFromURL ( $url)
 Fetch data from given external store URL.
 
 isReadOnly ( $location)
 Check if a given location is read-only.
 
 setLogger (LoggerInterface $logger)
 
 store ( $location, $data)
 Insert a data item into a given location.
 

Protected Attributes

string $dbDomain
 Default database domain to store content under.
 
bool $isDbDomainExplicit
 Whether this was factoried with an explicit DB domain.
 
LoggerInterface $logger
 
array $params = []
 Usage context options for this instance.
 

Detailed Description

Base class for external storage.

There can be multiple "locations" for a storage medium type (e.g. DB clusters, filesystems). Blobs are stored under URLs of the form <protocol>://<location>/<path>. Each type of storage medium has an associated protocol.

See also
ExternalStoreAccess
Since
1.21

Definition at line 25 of file ExternalStoreMedium.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\ExternalStore\ExternalStoreMedium::__construct ( array $params)
Parameters
array$paramsUsage context options for this instance:
  • domain: the DB domain ID of the wiki the content is for [required]
  • logger: LoggerInterface instance [optional]
  • isDomainImplicit: whether this was factoried without an explicit DB domain [optional]

Reimplemented in MediaWiki\ExternalStore\ExternalStoreDB, and MediaWiki\ExternalStore\ExternalStoreMwstore.

Definition at line 42 of file ExternalStoreMedium.php.

References MediaWiki\ExternalStore\ExternalStoreMedium\$params.

Member Function Documentation

◆ batchFetchFromURLs()

MediaWiki\ExternalStore\ExternalStoreMedium::batchFetchFromURLs ( array $urls)

Fetch data from given external store URLs.

Parameters
array$urlsA list of external store URLs
Returns
string[] Map of (url => text) for the URLs where data was actually found

Reimplemented in MediaWiki\ExternalStore\ExternalStoreDB, MediaWiki\ExternalStore\ExternalStoreMemory, and MediaWiki\ExternalStore\ExternalStoreMwstore.

Definition at line 73 of file ExternalStoreMedium.php.

References $url.

◆ fetchFromURL()

MediaWiki\ExternalStore\ExternalStoreMedium::fetchFromURL ( $url)
abstract

Fetch data from given external store URL.

Parameters
string$urlAn external store URL
Returns
string|bool The text stored or false on error
Exceptions
ExternalStoreException

Reimplemented in MediaWiki\ExternalStore\ExternalStoreDB, MediaWiki\ExternalStore\ExternalStoreHttp, MediaWiki\ExternalStore\ExternalStoreMemory, and MediaWiki\ExternalStore\ExternalStoreMwstore.

◆ isReadOnly()

MediaWiki\ExternalStore\ExternalStoreMedium::isReadOnly ( $location)

Check if a given location is read-only.

Parameters
string$locationThe location name
Returns
bool Whether this location is read-only
Since
1.31

Reimplemented in MediaWiki\ExternalStore\ExternalStoreMwstore, MediaWiki\ExternalStore\ExternalStoreDB, and MediaWiki\ExternalStore\ExternalStoreHttp.

Definition at line 103 of file ExternalStoreMedium.php.

◆ setLogger()

MediaWiki\ExternalStore\ExternalStoreMedium::setLogger ( LoggerInterface $logger)

Definition at line 54 of file ExternalStoreMedium.php.

◆ store()

MediaWiki\ExternalStore\ExternalStoreMedium::store ( $location,
$data )
abstract

Insert a data item into a given location.

Parameters
string$locationThe location name
string$dataThe data item
Returns
string|bool The URL of the stored data item, or false on error
Exceptions
ExternalStoreException

Reimplemented in MediaWiki\ExternalStore\ExternalStoreMwstore, MediaWiki\ExternalStore\ExternalStoreDB, MediaWiki\ExternalStore\ExternalStoreHttp, and MediaWiki\ExternalStore\ExternalStoreMemory.

Member Data Documentation

◆ $dbDomain

string MediaWiki\ExternalStore\ExternalStoreMedium::$dbDomain
protected

Default database domain to store content under.

Definition at line 29 of file ExternalStoreMedium.php.

Referenced by MediaWiki\ExternalStore\ExternalStoreMemory\fetchFromURL(), and MediaWiki\ExternalStore\ExternalStoreMemory\store().

◆ $isDbDomainExplicit

bool MediaWiki\ExternalStore\ExternalStoreMedium::$isDbDomainExplicit
protected

Whether this was factoried with an explicit DB domain.

Definition at line 31 of file ExternalStoreMedium.php.

◆ $logger

LoggerInterface MediaWiki\ExternalStore\ExternalStoreMedium::$logger
protected

Definition at line 34 of file ExternalStoreMedium.php.

◆ $params

array MediaWiki\ExternalStore\ExternalStoreMedium::$params = []
protected

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