MediaWiki master
|
Helper for storage of metadata. More...
Public Member Functions | |
__construct (LocalRepo $repo) | |
getJsonMetadata ( $file, $envelope) | |
Get metadata in JSON format ready for DB insertion, optionally splitting items out to BlobStore. | |
getMetadataFromBlobStore (array $addresses) | |
jsonDecode (string $s) | |
Do JSON decoding with local flags. | |
jsonEncode ( $data) | |
Do JSON encoding with local flags. | |
Helper for storage of metadata.
Sharing the code between LocalFile and ArchivedFile
Definition at line 35 of file MetadataStorageHelper.php.
MediaWiki\FileRepo\File\MetadataStorageHelper::__construct | ( | LocalRepo | $repo | ) |
Definition at line 39 of file MetadataStorageHelper.php.
MediaWiki\FileRepo\File\MetadataStorageHelper::getJsonMetadata | ( | $file, | |
$envelope ) |
Get metadata in JSON format ready for DB insertion, optionally splitting items out to BlobStore.
LocalFile | ArchivedFile | $file | |
array | $envelope |
Definition at line 51 of file MetadataStorageHelper.php.
References MediaWiki\Storage\BlobStore\IMAGE_HINT, and MediaWiki\FileRepo\File\MetadataStorageHelper\jsonEncode().
MediaWiki\FileRepo\File\MetadataStorageHelper::getMetadataFromBlobStore | ( | array | $addresses | ) |
Definition at line 109 of file MetadataStorageHelper.php.
MediaWiki\FileRepo\File\MetadataStorageHelper::jsonDecode | ( | string | $s | ) |
Do JSON decoding with local flags.
This doesn't use JsonCodec because JsonCodec can construct objects, which we don't want.
Does not throw. Returns false on failure.
string | $s |
Definition at line 147 of file MetadataStorageHelper.php.
MediaWiki\FileRepo\File\MetadataStorageHelper::jsonEncode | ( | $data | ) |
Do JSON encoding with local flags.
Callers must make sure that the data can be serialized.
mixed | $data |
Definition at line 98 of file MetadataStorageHelper.php.
Referenced by MediaWiki\FileRepo\File\MetadataStorageHelper\getJsonMetadata().