mirror of
https://github.com/librenms/librenms.git
synced 2024-09-28 22:06:25 +00:00
Add a couple of convenience functions to help make code tidier
This commit is contained in:
parent
f7b8936473
commit
6bfad7579c
@ -1247,3 +1247,23 @@ function ip_exists($ip) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* convenience function - please use this instead of 'if ($debug) { echo ...; }'
|
||||
*/
|
||||
function d_echo($text) {
|
||||
global $debug;
|
||||
if ($debug) {
|
||||
echo "$text\n";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* convenience function - please use this instead of 'if ($debug) { print_r ...; }'
|
||||
*/
|
||||
function d_print_r($var) {
|
||||
global $debug;
|
||||
if ($debug) {
|
||||
print_r($var);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user