Wikibase
MediaWiki Wikibase extension
|
JSON based unit conversion storage. More...
Public Member Functions | |
__construct ( $fileName) | |
Public Member Functions inherited from Wikibase\Lib\Units\BaseUnitStorage | |
isPrimaryUnit ( $unit) | |
Check if certain unit is primary. More... | |
getConversion ( $unit) | |
Get conversion from this unit to primary unit. More... | |
Protected Member Functions | |
loadStorageData () | |
Load data from concrete storage. More... | |
Private Attributes | |
$sourceFile | |
JSON based unit conversion storage.
Storage format: Json map, each element is 'Qsource': [ <factor>, 'QstandardUnit' ] Example: { "Q103510": [ "100000", "Q44395" ], "Q130964": [ "4.19", "Q25269" ], "Q182429": [ "1", "Q182429" ] } Q182429 here is a primary unit since source and standard are the same. Primary units must have factor of 1. Another acceptable format is: "Q103510": { "factor": "100000", "unit": "Q44395" },
Wikibase\Lib\Units\JsonUnitStorage::__construct | ( | $fileName | ) |
string | $fileName | Filename of the storage file. |
|
protected |
Load data from concrete storage.
Reimplemented from Wikibase\Lib\Units\BaseUnitStorage.
|
private |