ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Prettyjson.php
Go to the documentation of this file.
1 <?php
3 
4 use Exception;
5 
6 class Prettyjson extends Json
7 {
11  protected static function getEncodeOptions()
12  {
13  if (!(defined('\JSON_PRETTY_PRINT') && defined('\JSON_UNESCAPED_SLASHES') && defined('\JSON_UNESCAPED_UNICODE'))) {
14  throw new Exception('PHP 5.4 or later is required to export uncompressed JSON');
15  }
16  return \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE;
17  }
21  public static function getDescription()
22  {
23  return 'Build an uncompressed JSON-encoded file (PHP 5.4 or later is needed)';
24  }
25 }