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 31 of file MetadataStorageHelper.php.
MetadataStorageHelper::__construct | ( | LocalRepo | $repo | ) |
Definition at line 35 of file MetadataStorageHelper.php.
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 47 of file MetadataStorageHelper.php.
References jsonEncode().
MetadataStorageHelper::getMetadataFromBlobStore | ( | array | $addresses | ) |
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.
MetadataStorageHelper::jsonEncode | ( | $data | ) |
Do JSON encoding with local flags.
Callers must make sure that the data can be serialized.
mixed | $data |
Definition at line 94 of file MetadataStorageHelper.php.
Referenced by getJsonMetadata().