Merge branch '000-tool_debug' into 'develop'

add new params html_debug for strig in one line and new alias hd

See merge request artica/pandorafms!1789
This commit is contained in:
vgilc 2018-09-20 16:07:16 +02:00
commit da6fe0ec6b
1 changed files with 14 additions and 6 deletions

View File

@ -47,7 +47,7 @@ else{
/**
* Prints the print_r with < pre > tags
*/
function html_debug_print ($var, $file = '') {
function html_debug_print ($var, $file = '', $oneline = false) {
$more_info = '';
if (is_string($var)) {
$more_info = 'size: ' . strlen($var);
@ -66,6 +66,9 @@ function html_debug_print ($var, $file = '') {
if ($file === true)
$file = '/tmp/logDebug';
if($oneline && is_string($var))
$var = preg_replace("/[\t|\n| ]+/", " ", $var);
if (strlen($file) > 0) {
$f = fopen($file, "a");
ob_start();
@ -85,8 +88,13 @@ function html_debug_print ($var, $file = '') {
}
// Alias for "html_debug_print"
function html_debug ($var, $file = '') {
html_debug_print ($var, $file);
function html_debug ($var, $file = '', $oneline = false) {
html_debug_print ($var, $file, $oneline);
}
// Alias for "html_debug_print"
function hd ($var, $file = '', $oneline = false) {
html_debug_print ($var, $file, $oneline);
}
function html_f2str($function, $params) {