mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1265 from paulgear/convenience-functions
Add a couple of convenience functions to help make code tidier
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user