moved dev mode constant

This commit is contained in:
Steffen Schröder 2014-05-24 20:56:34 +02:00
parent 10c8ab92ef
commit c24b7d228e
4 changed files with 5 additions and 5 deletions

View File

@ -4,6 +4,7 @@
define('LOG_WRITE_CURRENT_FILE', 'ManiaControl.log'); // Write current log to extra file in base dir
define('LOG_NAME_USE_DATE', true); // Use current date as suffix for log file name in logs folder
define('LOG_NAME_USE_PID', true); // Use current process id as suffix for log file name in logs folder
define('DEV_MODE', false); // Development mode to not send error reports etc.
// Define base dir
define('ManiaControlDir', __DIR__ . DIRECTORY_SEPARATOR);

View File

@ -58,7 +58,7 @@ class ErrorHandler {
$logMessage = $message . PHP_EOL . 'Class: ' . $exceptionClass . PHP_EOL . 'Trace:' . PHP_EOL . $traceString;
$this->maniaControl->log($logMessage);
if (!ManiaControl::DEV_MODE) {
if (!DEV_MODE) {
$error = array();
$error['Type'] = 'Exception';
$error['Message'] = $message;
@ -224,7 +224,7 @@ class ErrorHandler {
}
$this->maniaControl->log($logMessage);
if (!ManiaControl::DEV_MODE && !$userError && !$suppressed) {
if (!DEV_MODE && !$userError && !$suppressed) {
$error = array();
$error['Type'] = 'Error';
$error['Message'] = $message;
@ -335,7 +335,7 @@ class ErrorHandler {
* @return bool
*/
private function shouldStopExecution($errorNumber) {
return ($errorNumber & E_ERROR || $errorNumber & E_USER_ERROR || $errorNumber & E_FATAL);
return ($errorNumber & E_FATAL);
}
/**

View File

@ -53,7 +53,6 @@ class ManiaControl implements CommandListener, TimerListener {
const OS_UNIX = 'Unix';
const OS_WIN = 'Windows';
const SCRIPT_TIMEOUT = 10;
const DEV_MODE = false;
const URL_WEBSERVICE = 'http://ws.maniacontrol.com/';
const SETTING_PERMISSION_SHUTDOWN = 'Shutdown ManiaControl';
const SETTING_PERMISSION_RESTART = 'Restart ManiaControl';

View File

@ -46,7 +46,7 @@ class UsageReporter implements TimerListener {
* @param float $time
*/
public function reportUsage($time) {
if (ManiaControl::DEV_MODE || !$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_REPORT_USAGE)) {
if (DEV_MODE || !$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_REPORT_USAGE)) {
return;
}