mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed plugins using d_echo (#9498)
Move d_echo to helpers.php and include in autoload Don't remove from common.php yet to be extra safe.
This commit is contained in:
committed by
Neil Lathwood
parent
757e984e5d
commit
8bddfe7225
@@ -657,20 +657,23 @@ function is_valid_hostname($hostname)
|
||||
/*
|
||||
* convenience function - please use this instead of 'if ($debug) { echo ...; }'
|
||||
*/
|
||||
function d_echo($text, $no_debug_text = null)
|
||||
{
|
||||
global $debug;
|
||||
if (!function_exists('d_echo')) {
|
||||
//TODO remove this after installs have updated, leaving it for for transition
|
||||
function d_echo($text, $no_debug_text = null)
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if (class_exists('\Log')) {
|
||||
\Log::debug(is_string($text) ? rtrim($text) : $text);
|
||||
} elseif ($debug) {
|
||||
print_r($text);
|
||||
}
|
||||
if (class_exists('\Log')) {
|
||||
\Log::debug(is_string($text) ? rtrim($text) : $text);
|
||||
} elseif ($debug) {
|
||||
print_r($text);
|
||||
}
|
||||
|
||||
if (!$debug && $no_debug_text) {
|
||||
echo "$no_debug_text";
|
||||
if (!$debug && $no_debug_text) {
|
||||
echo "$no_debug_text";
|
||||
}
|
||||
}
|
||||
} // d_echo
|
||||
}
|
||||
|
||||
/**
|
||||
* Output using console color if possible
|
||||
|
Reference in New Issue
Block a user