MediaWiki master
MediaWiki\ExternalStore\ExternalStoreMemory Class Reference

External storage in PHP process memory for testing. More...

Inherits MediaWiki\ExternalStore\ExternalStoreMedium.

Collaboration diagram for MediaWiki\ExternalStore\ExternalStoreMemory:

Public Member Functions

 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

 
 clear ()
 Remove all data from memory for this domain.
 
 fetchFromURL ( $url)
 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

 
 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
ExternalStoreException

 
- Public Member Functions inherited from MediaWiki\ExternalStore\ExternalStoreMedium
 __construct (array $params)
 
 isReadOnly ( $location)
 Check if a given location is read-only.
 
 setLogger (LoggerInterface $logger)
 

Additional Inherited Members

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

External storage in PHP process memory for testing.

In this system, each store "location" is separate PHP array. URLs are of the form "memory://location/id". The id/value pairs at each location are segregated by DB domain ID.

See also
ExternalStoreAccess
Since
1.33

Definition at line 22 of file ExternalStoreMemory.php.

Member Function Documentation

◆ batchFetchFromURLs()

MediaWiki\ExternalStore\ExternalStoreMemory::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 from MediaWiki\ExternalStore\ExternalStoreMedium.

Definition at line 39 of file ExternalStoreMemory.php.

References $url, and MediaWiki\ExternalStore\ExternalStoreMemory\fetchFromURL().

◆ clear()

MediaWiki\ExternalStore\ExternalStoreMemory::clear ( )

Remove all data from memory for this domain.

Definition at line 62 of file ExternalStoreMemory.php.

◆ fetchFromURL()

MediaWiki\ExternalStore\ExternalStoreMemory::fetchFromURL ( $url)

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 from MediaWiki\ExternalStore\ExternalStoreMedium.

Definition at line 29 of file ExternalStoreMemory.php.

References MediaWiki\ExternalStore\ExternalStoreMedium\$dbDomain, and $url.

Referenced by MediaWiki\ExternalStore\ExternalStoreMemory\batchFetchFromURLs().

◆ store()

MediaWiki\ExternalStore\ExternalStoreMemory::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
ExternalStoreException

Reimplemented from MediaWiki\ExternalStore\ExternalStoreMedium.

Definition at line 52 of file ExternalStoreMemory.php.

References MediaWiki\ExternalStore\ExternalStoreMedium\$dbDomain.


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