MediaWiki
1.33.0
|
Constructor class for key/value blob data kept in external repositories. More...
Static Public Member Functions | |
static | batchFetchFromURLs (array $urls) |
Fetch data from multiple URLs with a minimum of round trips. More... | |
static | defaultStoresAreReadOnly () |
static | fetchFromURL ( $url, array $params=[]) |
Fetch data from given URL. More... | |
static | getStoreObject ( $proto, array $params=[]) |
Get an external store object of the given type, with the given parameters. More... | |
static | insert ( $url, $data, array $params=[]) |
Store a data item to an external store, identified by a partial URL The protocol part is used to identify the class, the rest is passed to the class itself as a parameter. More... | |
static | insertToDefault ( $data, array $params=[]) |
Like insert() above, but does more of the work for us. More... | |
static | insertToForeignDefault ( $data, $wiki) |
static | insertWithFallback (array $tryStores, $data, array $params=[]) |
Like insert() above, but does more of the work for us. More... | |
Constructor class for key/value blob data kept in external repositories.
Objects in external stores are defined by a special URL. The URL is of the form "<store protocol>://<location>/<object name>". The protocol is used to determine what ExternalStoreMedium class is used. The location identifies particular storage instances or database clusters for store class to use.
When an object is inserted into a store, the calling code uses a partial URL of the form "<store protocol>://<location>" and receives the full object URL on success. This is useful since object names can be sequential IDs, UUIDs, or hashes. Callers are not responsible for unique name generation.
External repositories might be populated by maintenance/async scripts, thus partial moving of data may be possible, as well as the possibility to have any storage format (i.e. for archives).
Definition at line 48 of file ExternalStore.php.
|
static |
Fetch data from multiple URLs with a minimum of round trips.
array | $urls | The URLs of the text to get |
MWException |
Definition at line 97 of file ExternalStore.php.
References as, and getStoreObject().
|
static |
Definition at line 226 of file ExternalStore.php.
References $path, $wgDefaultExternalStore, array(), as, getStoreObject(), and list.
Referenced by MediaWiki\Storage\SqlBlobStore\isReadOnly().
|
static |
Fetch data from given URL.
string | $url | The URL of the text to get |
array | $params | Associative array of ExternalStoreMedium parameters |
MWException |
Definition at line 70 of file ExternalStore.php.
References $params, $path, captcha-old\count, getStoreObject(), and list.
Referenced by FixT22757\execute(), MediaWiki\Storage\SqlBlobStore\expandBlob(), HistoryBlobStub\getText(), FixT22757\isUnbrokenStub(), ExternalStoreTest\testExternalFetchFromURL_noExternalStores(), and ExternalStoreTest\testExternalFetchFromURL_someExternalStore().
|
static |
Get an external store object of the given type, with the given parameters.
string | $proto | Type of external storage, should be a value in $wgExternalStores |
array | $params | Associative array of ExternalStoreMedium parameters |
Definition at line 56 of file ExternalStore.php.
References $params.
Referenced by batchFetchFromURLs(), defaultStoresAreReadOnly(), fetchFromURL(), MediaWikiTestCase\getExternalStoreDatabaseConnections(), insert(), and insertWithFallback().
|
static |
Store a data item to an external store, identified by a partial URL The protocol part is used to identify the class, the rest is passed to the class itself as a parameter.
string | $url | A partial external store URL ("<store type>://<location>") |
string | $data | |
array | $params | Associative array of ExternalStoreMedium parameters |
MWException |
Definition at line 135 of file ExternalStore.php.
References $data, $params, $path, captcha-old\count, getStoreObject(), and list.
|
static |
Like insert() above, but does more of the work for us.
This function does not need a url param, it builds it by itself. It also fails-over to the next possible clusters provided by $wgDefaultExternalStore.
string | $data | |
array | $params | Map of ExternalStoreMedium::__construct context parameters |
MWException |
Definition at line 165 of file ExternalStore.php.
References $data, $params, $wgDefaultExternalStore, array(), and insertWithFallback().
Referenced by MigrateArchiveText\doDBUpdates(), insertToForeignDefault(), and MediaWiki\Storage\SqlBlobStore\storeBlob().
|
static |
string | $data | |
string | $wiki |
MWException |
Definition at line 251 of file ExternalStore.php.
References $data, and insertToDefault().
Like insert() above, but does more of the work for us.
This function does not need a url param, it builds it by itself. It also fails-over to the next possible clusters as provided in the first parameter.
array | $tryStores | Refer to $wgDefaultExternalStore |
string | $data | |
array | $params | Map of ExternalStoreMedium::__construct context parameters |
MWException |
Definition at line 183 of file ExternalStore.php.
References $data, $params, $path, captcha-old\count, getStoreObject(), list, wfDebug(), and wfDebugLog().
Referenced by insertToDefault().