diff --git a/discovery.php b/discovery.php index 963c8dce7..385aa8e3a 100755 --- a/discovery.php +++ b/discovery.php @@ -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 | 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"); diff --git a/html/index.php b/html/index.php index 33caf1be6..e244584b3 100755 --- a/html/index.php +++ b/html/index.php @@ -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"); diff --git a/poller.php b/poller.php index 53443ec8b..b3ac73af7 100755 --- a/poller.php +++ b/poller.php @@ -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");