MediaWiki REL1_39
|
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 30 of file MetadataStorageHelper.php.
MetadataStorageHelper::__construct | ( | LocalRepo | $repo | ) |
Definition at line 34 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 46 of file MetadataStorageHelper.php.
References $file, $s, and 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 148 of file MetadataStorageHelper.php.
References $s.
MetadataStorageHelper::jsonEncode | ( | $data | ) |
Do JSON encoding with local flags.
Throw an exception if the data cannot be serialized.
MWException |
mixed | $data |
Definition at line 95 of file MetadataStorageHelper.php.
Referenced by getJsonMetadata().