MediaWiki  master
ExternalStoreMwstore Class Reference

External storage in a FileBackend. More...

Inheritance diagram for ExternalStoreMwstore:
Collaboration diagram for ExternalStoreMwstore:

Public Member Functions

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

Private Attributes

FileBackendGroup $fbGroup
 

Additional Inherited Members

- Protected Attributes inherited from ExternalStoreMedium
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

External storage in a FileBackend.

In this system, each store "location" maps to the name of a file backend. The file backends must be defined in $wgFileBackends and must be global and fully qualified with a global "wikiId" prefix in the configuration.

See also
ExternalStoreAccess
Since
1.21

Definition at line 32 of file ExternalStoreMwstore.php.

Constructor & Destructor Documentation

◆ __construct()

ExternalStoreMwstore::__construct ( array  $params)
See also
ExternalStoreMedium::__construct()
Parameters
array$paramsAdditional parameters include:

Reimplemented from ExternalStoreMedium.

Definition at line 41 of file ExternalStoreMwstore.php.

References ExternalStoreMedium\$params.

Member Function Documentation

◆ batchFetchFromURLs()

ExternalStoreMwstore::batchFetchFromURLs ( array  $urls)

Fetch data from given external store URLs.

The URLs are in the form of mwstore://backend/container/wiki/id

Parameters
array$urlsAn array of external store URLs
Returns
array A map from url to stored content. Failed results are not represented.

Reimplemented from ExternalStoreMedium.

Definition at line 74 of file ExternalStoreMwstore.php.

◆ fetchFromURL()

ExternalStoreMwstore::fetchFromURL (   $url)

Fetch data from a given external store URL.

See also
ExternalStoreMedium::fetchFromURL()
Parameters
string$urlAn external store URL in the form of mwstore://backend/container/wiki/id
Returns
string|bool

Reimplemented from ExternalStoreMedium.

Definition at line 56 of file ExternalStoreMwstore.php.

◆ isReadOnly()

ExternalStoreMwstore::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 from ExternalStoreMedium.

Definition at line 118 of file ExternalStoreMwstore.php.

◆ store()

ExternalStoreMwstore::store (   $location,
  $data 
)

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 from ExternalStoreMedium.

Definition at line 91 of file ExternalStoreMwstore.php.

References WikiMap\getWikiIdFromDbDomain(), and UIDGenerator\newTimestampedUID128().

Member Data Documentation

◆ $fbGroup

FileBackendGroup ExternalStoreMwstore::$fbGroup
private

Definition at line 34 of file ExternalStoreMwstore.php.


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