JSON_PRETTY_PRINT compatibility for PHP < 5.4.0 ("--dump-schema")

This commit is contained in:
Shawn Iwinski 2014-08-29 22:41:25 -04:00
parent 34e298213d
commit 1fc065c8d7

View File

@ -218,7 +218,8 @@ $refResolver = new JsonSchema\RefResolver($retriever);
$refResolver->resolve($schema, $urlSchema);
if (isset($arOptions['--dump-schema'])) {
echo json_encode($schema, JSON_PRETTY_PRINT) . "\n";
$options = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
echo json_encode($schema, $options) . "\n";
exit();
}