added debug functions
This commit is contained in:
parent
04f6f50f28
commit
916657e09c
26
app/debug.php
Normal file
26
app/debug.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
function debug_print($obj)
|
||||
{
|
||||
printf('<pre>%s</pre>', print_r($obj, 1));
|
||||
}
|
||||
|
||||
function debug_var_dump($obj)
|
||||
{
|
||||
printf('<pre>%s</pre>', var_dump_str($obj));
|
||||
}
|
||||
|
||||
function var_dump_str()
|
||||
{
|
||||
$argc = func_num_args();
|
||||
$argv = func_get_args();
|
||||
|
||||
if ($argc > 0) {
|
||||
ob_start();
|
||||
call_user_func_array('var_dump', $argv);
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $result;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@ -1,9 +1,6 @@
|
||||
<?php
|
||||
|
||||
function debug_print($obj)
|
||||
{
|
||||
printf('<pre>%s</pre>', print_r($obj,1));
|
||||
}
|
||||
require '../app/debug.php';
|
||||
|
||||
require '../lib/autoload.php';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user