Ignore:
Timestamp:
Apr 23, 2021 11:00:26 PM (3 years ago)
Author:
anonymous
Message:

Add SC_DUMP_JSON flag to dump(). Update comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Utilities.inc.php

    r742 r743  
    3838define('SC_DUMP_VAR_DUMP', 1);
    3939define('SC_DUMP_VAR_EXPORT', 2);
     40define('SC_DUMP_JSON', 3);
    4041function dump($var, $display=false, $dump_method=SC_DUMP_PRINT_R, $file='', $line='')
    4142{
     
    7374    case SC_DUMP_VAR_EXPORT:
    7475        var_export($var);
     76        break;
     77
     78    case SC_DUMP_JSON:
     79        json_encode($var, JSON_PRETTY_PRINT);
    7580        break;
    7681    }
     
    15431548*
    15441549* @access   public
    1545 * @param    string  $url    URL to a file.
    1546 * @return   bool            True if the resource exists, false otherwise.
     1550* @param    string  $url     URL to a file.
     1551* @param    int     $timeout The maximum number of seconds to allow the HTTP query to execute.
     1552* @return   bool             True if the resource exists, false otherwise.
    15471553* @author   Quinn Comendant <quinn@strangecode.com>
    15481554* @version  2.0
Note: See TracChangeset for help on using the changeset viewer.