- Timestamp:
- Feb 26, 2023 9:21:30 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r774 r781 29 29 * Print variable dump. 30 30 * 31 * @param mixed $var The variable to dump.32 * @param bool $display Print the dump in <pre> tags or hide it in html comments (non-CLI only).33 * @param bool $dump_methodDump method. See SC_DUMP_* constants.34 * @param string $file Value of __FILE__.35 * @param string $line Value of __LINE__31 * @param mixed $var The variable to dump. 32 * @param bool $display Print the dump in <pre> tags or hide it in html comments (non-CLI only). 33 * @param const $dump_method Dump method. See SC_DUMP_* constants. 34 * @param string $file Value of __FILE__. 35 * @param string $line Value of __LINE__ 36 36 */ 37 37 define('SC_DUMP_PRINT_R', 0); … … 116 116 * 117 117 * @access public 118 * @param mixed $var The variable to dump. 119 * @param bool $serialize If true, remove line-endings. Useful for logging variables. 120 * @return string The dumped variable. 118 * @param mixed $var The variable to dump. 119 * @param bool $serialize If true, remove line-endings. Useful for logging variables. 120 * @param const $dump_method Dump method. See SC_DUMP_* constants. 121 * @return string The dumped variable. 121 122 * @author Quinn Comendant <quinn@strangecode.com> 122 123 */ … … 162 163 163 164 case SC_DUMP_JSON: 164 $ d = json_encode($var, JSON_PRETTY_PRINT);165 break;165 $json_flags = $serialize ? 0 : JSON_PRETTY_PRINT; 166 return json_encode($var, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK | $json_flags); 166 167 } 167 168 return $serialize ? preg_replace('/\s+/m' . $app->getParam('preg_u'), ' ', $d) : $d;
Note: See TracChangeset
for help on using the changeset viewer.