initial commit
This commit is contained in:
commit
e869a1cab4
107 changed files with 9029 additions and 0 deletions
24
app/library/Debug.php
Normal file
24
app/library/Debug.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
class Debug {
|
||||
|
||||
public static function dump($var, $label = null, $echo = true)
|
||||
{
|
||||
// format the label
|
||||
$label = ($label===null) ? '' : rtrim($label) . ' ';
|
||||
// var_dump the variable into a buffer and keep the output
|
||||
ob_start();
|
||||
var_dump($var);
|
||||
$output = ob_get_clean();
|
||||
// neaten the newlines and indents
|
||||
$output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
|
||||
$output = '<pre>'
|
||||
. $label
|
||||
. $output
|
||||
. '</pre>';
|
||||
if ($echo) {
|
||||
echo $output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
Reference in a new issue