Archived
1
0
Fork 0

initial commit

This commit is contained in:
Henrik Hautakoski 2017-09-01 17:10:27 +02:00
commit e869a1cab4
107 changed files with 9029 additions and 0 deletions

24
app/library/Debug.php Normal file
View 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;
}
}