MediaWiki
REL1_21
|
JSON formatter wrapper class. More...
Static Public Member Functions | |
static | decode ($value, $assoc=false) |
Decodes a JSON string. | |
static | encode ($value, $pretty=false) |
Returns the JSON representation of a value. |
JSON formatter wrapper class.
Definition at line 28 of file FormatJson.php.
static FormatJson::decode | ( | $ | value, |
$ | assoc = false |
||
) | [static] |
Decodes a JSON string.
string | $value | the json string being decoded. |
$assoc | Boolean: when true, returned objects will be converted into associative arrays. |
Definition at line 58 of file FormatJson.php.
References $value.
Referenced by ForeignAPIRepo\fetchImageQuery(), ResourceLoaderModule\getFileDependencies(), MessageBlobStore\getFromDB(), MediaWikiSite\normalizePageName(), ResourceLoader\preloadModuleInfo(), MessageBlobStore\reencodeBlob(), JsonTest\testDecodeVarTypes(), and MessageBlobStore\updateModule().
static FormatJson::encode | ( | $ | value, |
$ | pretty = false |
||
) | [static] |
Returns the JSON representation of a value.
$value | Mixed: the value being encoded. Can be any type except a resource. |
$pretty | Boolean: If true, adds non-significant whitespace to improve readability. |
Definition at line 38 of file FormatJson.php.
References $value.
Referenced by GetConfiguration\execute(), ApiFormatJson\execute(), MessageBlobStore\generateMessageBlob(), ResourceLoaderFileModule\getStyles(), MessageBlobStore\reencodeBlob(), JsonTest\testPhpBug46944Test(), and GenerateJqueryMsgData\writeJavascriptFile().