Compare commits

..

3 Commits

Author SHA1 Message Date
Clemens Schwaighofer
9d131cf6dd Bug: Remove echo in call 2024-10-17 13:58:52 +09:00
Clemens Schwaighofer
dfcae20f64 Update DB\IO and do not print call steck on DB_INFO calls 2024-10-17 13:52:44 +09:00
Clemens Schwaighofer
61e489ee4c Remove entries from an array wrapper
just wrapper around array_diff
2024-10-17 09:44:24 +09:00
2 changed files with 29 additions and 10 deletions

View File

@@ -509,6 +509,22 @@ class ArrayHandler
} }
return $array; return $array;
} }
/**
* Remove entries from a simple array, will not keep key order
*
* any array content is allowed
*
* https://stackoverflow.com/a/369608
*
* @param array<mixed> $array Array where elements are located
* @param array<mixed> $remove Elements to remove
* @return array<mixed> Array with $remove elements removed
*/
public static function arrayRemoveEntry(array $array, array $remove): array
{
return array_diff($array, $remove);
}
} }
// __END__ // __END__

View File

@@ -823,6 +823,10 @@ class IO
); );
break; break;
default: default:
// no context on DB_INFO
if ($id == 'DB_INFO') {
$context = [];
}
// used named arguments so we can easy change the order of debug // used named arguments so we can easy change the order of debug
$this->log->debug( $this->log->debug(
group_id: $debug_id, group_id: $debug_id,
@@ -1814,14 +1818,13 @@ class IO
$html_tags = ['{b}', '{/b}', '{br}']; $html_tags = ['{b}', '{/b}', '{br}'];
$replace_html = ['<b>', '</b>', '<br>']; $replace_html = ['<b>', '</b>', '<br>'];
$replace_text = ['', '', ' **** ']; $replace_text = ['', '', ' **** '];
$string = ''; $string = '{b}-DB-info->{/b} Connected to db {b}\'' . $this->db_name . '\'{/b} '
$string .= '{b}-DB-info->{/b} Connected to db {b}\'' . $this->db_name . '\'{/b} '; . 'with schema {b}\'' . $this->db_schema . '\'{/b} '
$string .= 'with schema {b}\'' . $this->db_schema . '\'{/b} '; . 'as user {b}\'' . $this->db_user . '\'{/b} '
$string .= 'as user {b}\'' . $this->db_user . '\'{/b} '; . 'at host {b}\'' . $this->db_host . '\'{/b} '
$string .= 'at host {b}\'' . $this->db_host . '\'{/b} '; . 'on port {b}\'' . $this->db_port . '\'{/b} '
$string .= 'on port {b}\'' . $this->db_port . '\'{/b} '; . 'with ssl mode {b}\'' . $this->db_ssl . '\'{/b}{br}'
$string .= 'with ssl mode {b}\'' . $this->db_ssl . '\'{/b}{br}'; . '{b}-DB-info->{/b} DB IO Class debug output: {b}'
$string .= '{b}-DB-info->{/b} DB IO Class debug output: {b}'
. ($this->dbGetDebug() ? 'Yes' : 'No') . '{/b}'; . ($this->dbGetDebug() ? 'Yes' : 'No') . '{/b}';
if ($log === true) { if ($log === true) {
// if debug, remove / change b // if debug, remove / change b
@@ -1829,7 +1832,7 @@ class IO
$html_tags, $html_tags,
$replace_text, $replace_text,
$string $string
), 'dbInfo'); ), 'DB_INFO');
} else { } else {
$string = $string . '{br}'; $string = $string . '{br}';
} }
@@ -1985,7 +1988,7 @@ class IO
if (is_array($array)) { if (is_array($array)) {
$this->nbsp = ''; $this->nbsp = '';
$string .= $this->__printArray($array); $string .= $this->__printArray($array);
$this->__dbDebugMessage('db', $string, 'dbDumpData'); $this->__dbDebugMessage('db', $string, 'DB_INFO');
} }
return $string; return $string;
} }