MediaWiki REL1_31
|
Service for loading and storing data blobs. More...
Public Member Functions | |
getBlob ( $blobAddress, $queryFlags=0) | |
Retrieve a blob, given an address. | |
isReadOnly () | |
Check if the blob metadata or backing blob data store is read-only. | |
storeBlob ( $data, $hints=[]) | |
Stores an arbitrary blob of data and returns an address that can be used with getBlob() to retrieve the same blob of data,. | |
Public Attributes | |
const | DESIGNATION_HINT = 'designation' |
Hint key for use with storeBlob, indicating the general role the block takes in the application. | |
const | FORMAT_HINT = 'cont_format' |
Hint key for use with storeBlob, indicating the serialization format used to create the blob, as a MIME type. | |
const | MODEL_HINT = 'cont_model' |
Hint key for use with storeBlob, indicating the model of the content encoded in the given blob. | |
const | PAGE_HINT = 'page_id' |
Hint key for use with storeBlob, indicating the page the blob is associated with. | |
const | PARENT_HINT = 'rev_parent_id' |
Hint key for use with storeBlob, indicating the parent revision of the revision the blob is associated with. | |
const | REVISION_HINT = 'rev_id' |
Hint key for use with storeBlob, indicating the revision the blob is associated with. | |
const | ROLE_HINT = 'role_name' |
Hint key for use with storeBlob, indicating the slot the blob is associated with. | |
const | SHA1_HINT = 'cont_sha1' |
Hint key for use with storeBlob, providing the SHA1 hash of the blob as passed to the method. | |
Service for loading and storing data blobs.
Definition at line 33 of file BlobStore.php.
MediaWiki\Storage\BlobStore::getBlob | ( | $blobAddress, | |
$queryFlags = 0 ) |
Retrieve a blob, given an address.
MCR migration note: this replaces Revision::loadText
string | $blobAddress | The blob address as returned by storeBlob(), such as "tt:12345" or "ex:DB://s16/456/9876". |
int | $queryFlags | See IDBAccessObject. |
BlobAccessException |
Implemented in MediaWiki\Storage\SqlBlobStore.
MediaWiki\Storage\BlobStore::isReadOnly | ( | ) |
Check if the blob metadata or backing blob data store is read-only.
Implemented in MediaWiki\Storage\SqlBlobStore.
MediaWiki\Storage\BlobStore::storeBlob | ( | $data, | |
$hints = [] ) |
Stores an arbitrary blob of data and returns an address that can be used with getBlob() to retrieve the same blob of data,.
string | $data | raw binary data |
array | $hints | An array of hints. Implementations may use the hints to optimize storage. All hints are optional, supported hints depend on the implementation. Hint names by convention correspond to the names of fields in the database. Callers are encouraged to provide the well known hints as defined by the XXX_HINT constants. |
BlobAccessException |
Implemented in MediaWiki\Storage\SqlBlobStore.
const MediaWiki\Storage\BlobStore::DESIGNATION_HINT = 'designation' |
Hint key for use with storeBlob, indicating the general role the block takes in the application.
For instance, it should be "page-content" if the blob represents a Content object.
Definition at line 40 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::FORMAT_HINT = 'cont_format' |
Hint key for use with storeBlob, indicating the serialization format used to create the blob, as a MIME type.
May be used for optimized storage in the underlying database.
Definition at line 82 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::MODEL_HINT = 'cont_model' |
Hint key for use with storeBlob, indicating the model of the content encoded in the given blob.
May be used to implement optimized storage for some well known models.
Definition at line 76 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::PAGE_HINT = 'page_id' |
Hint key for use with storeBlob, indicating the page the blob is associated with.
This may be used for sharding.
Definition at line 46 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::PARENT_HINT = 'rev_parent_id' |
Hint key for use with storeBlob, indicating the parent revision of the revision the blob is associated with.
This may be used for differential storage.
Definition at line 64 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::REVISION_HINT = 'rev_id' |
Hint key for use with storeBlob, indicating the revision the blob is associated with.
This may be used for differential storage and reference counting.
Definition at line 58 of file BlobStore.php.
const MediaWiki\Storage\BlobStore::ROLE_HINT = 'role_name' |
Hint key for use with storeBlob, indicating the slot the blob is associated with.
May be relevant for reference counting.
Definition at line 52 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().
const MediaWiki\Storage\BlobStore::SHA1_HINT = 'cont_sha1' |
Hint key for use with storeBlob, providing the SHA1 hash of the blob as passed to the method.
This can be used to avoid re-calculating the hash if it is needed by the BlobStore.
Definition at line 70 of file BlobStore.php.
Referenced by MediaWiki\Storage\RevisionStore\insertRevisionOn().