MediaWiki  1.34.0
ExternalStoreMedium Class Reference

Key/value blob storage for a particular storage medium type (e.g. More...

Inheritance diagram for ExternalStoreMedium:
Collaboration diagram for ExternalStoreMedium:

Public Member Functions

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

Protected Attributes

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

Detailed Description

Key/value blob storage for a particular storage medium type (e.g.

RDBMs, files)

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.

Since
1.21

Definition at line 38 of file ExternalStoreMedium.php.

Constructor & Destructor Documentation

◆ __construct()

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 ExternalStoreDB, ExternalStoreMwstore, and ExternalStoreMemory.

Definition at line 55 of file ExternalStoreMedium.php.

References $params.

Member Function Documentation

◆ batchFetchFromURLs()

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 ExternalStoreDB, ExternalStoreMwstore, and ExternalStoreMemory.

Definition at line 86 of file ExternalStoreMedium.php.

References fetchFromURL().

◆ fetchFromURL()

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
MWException

Reimplemented in ExternalStoreDB, ExternalStoreMwstore, ExternalStoreMemory, and ExternalStoreHttp.

Referenced by batchFetchFromURLs().

◆ isReadOnly()

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 ExternalStoreDB, ExternalStoreHttp, and ExternalStoreMwstore.

Definition at line 116 of file ExternalStoreMedium.php.

◆ setLogger()

ExternalStoreMedium::setLogger ( LoggerInterface  $logger)

Definition at line 67 of file ExternalStoreMedium.php.

References $logger.

◆ store()

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
MWException

Reimplemented in ExternalStoreDB, ExternalStoreMemory, ExternalStoreHttp, and ExternalStoreMwstore.

Member Data Documentation

◆ $dbDomain

string ExternalStoreMedium::$dbDomain
protected

Default database domain to store content under.

Definition at line 42 of file ExternalStoreMedium.php.

Referenced by ExternalStoreMemory\fetchFromURL(), ExternalStoreDB\getDomainId(), and ExternalStoreMemory\store().

◆ $isDbDomainExplicit

bool ExternalStoreMedium::$isDbDomainExplicit
protected

Whether this was factoried with an explicit DB domain.

Definition at line 44 of file ExternalStoreMedium.php.

◆ $logger

LoggerInterface ExternalStoreMedium::$logger
protected

Definition at line 47 of file ExternalStoreMedium.php.

Referenced by setLogger().

◆ $params

array ExternalStoreMedium::$params = []
protected

Usage context options for this instance.

Definition at line 40 of file ExternalStoreMedium.php.

Referenced by ExternalStoreMemory\__construct(), ExternalStoreMwstore\__construct(), ExternalStoreDB\__construct(), and __construct().


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