|
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 21 of file MetadataStorageHelper.php.
| MediaWiki\FileRepo\File\MetadataStorageHelper::__construct | ( | LocalRepo | $repo | ) |
Definition at line 25 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 37 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 95 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 133 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 84 of file MetadataStorageHelper.php.
Referenced by MediaWiki\FileRepo\File\MetadataStorageHelper\getJsonMetadata().