The Date class provides some functions for debugging.
This method return a prettified output of $data.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$data | mixed | $data can contain any kind of data (array, object etc.). |
$data = new \stdClass();
$data->userId = 1000;
$data->data = array(
'forename' => 'John',
'surname' => 'Doe'
);
Debug::dump($data);
//Output:
Variable #1:
(Object #2): stdClass
public userId (Integer): 1000
public data (Array, 2 elements)
forename (String): "John" (4 characters)
surname (String): "Doe" (3 characters)
This method returns a backtrace.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
Debug::backtrace();
//Output
Variable #1:
(Array, 1 element)
0 (Array, 6 elements)
file (String): "/var/www/httpdocs/public/debug-test.php" (39 characters)
line (Integer): 32
function (String): "backtrace" (9 characters)
class (String): "LPF\Core\Debug" (14 characters)
type (String): "::" (2 characters)
args (Array, 0 elements)
This method return all loaded classes. By default it will be only output the Framework own loaded classes.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$all | boolean | Set to true to get all declared classes. |
Debug::classes();
// Output
Variable #1:
(Array, 6 elements)
0 (String): "LPF\Core\Autoloader" (19 characters)
1 (String): "LPF\Core\LPFException" (21 characters)
2 (String): "LPF\Core\LPF" (12 characters)
3 (String): "LPF\Core\Config" (15 characters)
4 (String): "LPF\Core\Date" (13 characters)
5 (String): "LPF\Core\Debug" (14 characters)
This method return all declared interfaces.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$all | boolean | Set to true to get all declared interfaces. |
Debug::interfaces();
// Output
Variable #1:
(Array, 12 elements)
0 (String): "Traversable" (11 characters)
1 (String): "IteratorAggregate" (17 characters)
2 (String): "Iterator" (8 characters)
3 (String): "ArrayAccess" (11 characters)
4 (String): "Serializable" (12 characters)
5 (String): "Reflector" (9 characters)
6 (String): "RecursiveIterator" (17 characters)
7 (String): "OuterIterator" (13 characters)
8 (String): "Countable" (9 characters)
9 (String): "SeekableIterator" (16 characters)
10 (String): "SplObserver" (11 characters)
11 (String): "SplSubject" (10 characters)
This method return all included or required files.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
Debug::includes();
This method return all defined constants.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
Debug::constants();
This method return all loaded extensions.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
Debug::extensions();
This method return the value of a configuration option.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$value | string | Required | The configuration option name. |
Debug::get_ini('allow_url_fopen');
// Output:
Variable #1:
(String): "1" (1 characters)
This method return all configuration options.
Static | Yes | |||
Parameters | Parameter | Type | Default | Description |
$value | string | Optional | An optional extension name. If set, the function return only options specific for that extension. |
Debug::get_ini_all('date');
// Output:
Variable #1:
(Array, 5 elements)
date.default_latitude (Array, 3 elements)
global_value (String): "31.7667" (7 characters)
local_value (String): "31.7667" (7 characters)
access (Integer): 7
date.default_longitude (Array, 3 elements)
global_value (String): "35.2333" (7 characters)
local_value (String): "35.2333" (7 characters)
access (Integer): 7
date.sunrise_zenith (Array, 3 elements)
global_value (String): "90.583333" (9 characters)
local_value (String): "90.583333" (9 characters)
access (Integer): 7
date.sunset_zenith (Array, 3 elements)
global_value (String): "90.583333" (9 characters)
local_value (String): "90.583333" (9 characters)
access (Integer): 7
date.timezone (Array, 3 elements)
global_value (String): "" (0 characters)
local_value (String): "" (0 characters)
access (Integer): 7