1
0
Fork 0

Use JSON_PRETTY_PRINT option when dumping JSON to help debugging

pull/175/head
Fabien Potencier 2011-12-27 11:33:43 +01:00
parent 9b2694351b
commit 90f2a9f406
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,11 @@ namespace Composer\Json;
use Composer\Repository\RepositoryManager; use Composer\Repository\RepositoryManager;
use Composer\Composer; use Composer\Composer;
// defined as of PHP 5.4
if (!defined('JSON_PRETTY_PRINT')) {
define('JSON_PRETTY_PRINT', 128);
}
/** /**
* Reads/writes json files. * Reads/writes json files.
* *
@ -91,7 +96,7 @@ class JsonFile
); );
} }
} }
file_put_contents($this->path, json_encode($hash)); file_put_contents($this->path, json_encode($hash, JSON_PRETTY_PRINT));
} }
/** /**