FormatJson: Make it possible to change the indent string
authorKevin Israel <pleasestand@live.com>
Thu, 3 Apr 2014 01:51:09 +0000 (21:51 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 16 Apr 2014 14:00:10 +0000 (10:00 -0400)
commit1efdda25ee5cbaea2b7e2dd7afdbaf53063d4b68
tree58db249ab53d92045c496fc08beef59d472012b8
parent1360206275f5d9d141240356d3d9939b0ebcea89
FormatJson: Make it possible to change the indent string

This is to allow consistency with MediaWiki PHP and JS files (e.g. when
generating JSON i18n files), not because tabs are "better" than spaces for
indenting code (both have advantages and disadvantages).

Because PHP's json_encode() function hardcodes the indent string, using tabs
has a performance cost (in post-processing the output) and is less suitable
for web output; thus the API and ResourceLoader debug mode will continue to
use four spaces. Adjusting the maintenance scripts and JSON files is left to
separate change sets.

Bug: 63444
Change-Id: Ic915c50b0acd2e236940b70d5dd48ea87954c9d5
RELEASE-NOTES-1.24
includes/json/FormatJson.php
tests/phpunit/includes/json/FormatJsonTest.php