disable warnings/errors if not debugging

git-svn-id: http://www.observium.org/svn/observer/trunk@1688 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-08-21 12:54:42 +00:00
parent 47ee7a71ed
commit a92ce17f21
3 changed files with 36 additions and 6 deletions

View File

@@ -36,6 +36,22 @@ if ($options['i'] && isset($options['n'])) {
$doing = $options['n'] ."/".$options['i'];
}
if (isset($options['d'])) {
echo("DEBUG!\n");
$debug = TRUE;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
ini_set('error_reporting', 1);
} else {
$debug = FALSE;
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
ini_set('log_errors', 0);
ini_set('error_reporting', 0);
}
if(!$where) {
echo("-h <device id> | <device hostname> Poll single device\n");
echo("-h odd Poll odd numbered devices (same as -i 2 -n 0)\n");
@@ -95,11 +111,6 @@ if (file_exists('.svn'))
}
}
if(isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; } else { $debug = 0; }
$devices_discovered = 0;
$device_query = mysql_query("SELECT * FROM `devices` WHERE status = 1 AND disabled = 0 $where ORDER BY device_id DESC");

View File

@@ -10,6 +10,12 @@ if(strpos($_SERVER['REQUEST_URI'], "debug")) {
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
ini_set('error_reporting', E_ALL);
} else {
$debug = FALSE;
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
ini_set('log_errors', 0);
ini_set('error_reporting', 0);
}
include("../includes/defaults.inc.php");

View File

@@ -46,7 +46,20 @@ if (!$where) {
exit;
}
if (isset($options['d'])) { echo("DEBUG!\n"); $debug = 1; }
if (isset($options['d'])) {
echo("DEBUG!\n");
$debug = TRUE;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
ini_set('error_reporting', 1);
} else {
$debug = FALSE;
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
ini_set('log_errors', 0);
ini_set('error_reporting', 0);
}
echo("Starting polling run:\n\n");