42 throw new UnexpectedValueException(
"Missing ID in URL component." );
50 foreach ( $urls as $url ) {
52 if (
$blob !==
false ) {
64 return "memory://$location/$index";
71 foreach ( self::$data as &$dataForLocation ) {
72 unset( $dataForLocation[$this->dbDomain] );
74 unset( $dataForLocation );
75 self::$data = array_filter( self::$data,
'count' );
85 list( $proto,
$path ) = explode(
'://', $url, 2 ) + [
null, null ];
86 if ( $proto !==
'memory' ) {
87 throw new UnexpectedValueException(
"Got URL of protocol '$proto', not 'memory'." );
88 } elseif (
$path ===
null ) {
89 throw new UnexpectedValueException(
"URL is missing path component." );
92 $parts = explode(
'/',
$path );
93 if ( count( $parts ) > 2 ) {
94 throw new UnexpectedValueException(
"Too components in URL '$path'." );
97 return [ $parts[0], $parts[1] ?? null ];
Key/value blob storage for a particular storage medium type (e.g.
string $dbDomain
Default database domain to store content under.
Process memory based external objects for testing.
clear()
Remove all data from memory for this domain.
static array[] $data
Map of (location => DB domain => id => value)
fetchFromURL( $url)
Fetch data from given external store URL.
batchFetchFromURLs(array $urls)
Fetch data from given external store URLs.
store( $location, $data)
Insert a data item into a given location.