Add a setting to disable reports on maniacontrol.com
This commit is contained in:
parent
f6a417bea5
commit
9959373343
@ -22,6 +22,7 @@ class ErrorHandler {
|
|||||||
*/
|
*/
|
||||||
const MC_DEBUG_NOTICE = 'ManiaControl.DebugNotice';
|
const MC_DEBUG_NOTICE = 'ManiaControl.DebugNotice';
|
||||||
const SETTING_RESTART_ON_EXCEPTION = 'Automatically restart on Exceptions';
|
const SETTING_RESTART_ON_EXCEPTION = 'Automatically restart on Exceptions';
|
||||||
|
const SETTING_REPORT_ON_MANIACONTROLCOM = 'Report errors on Maniacontrol.com';
|
||||||
const LOG_SUPPRESSED_ERRORS = false;
|
const LOG_SUPPRESSED_ERRORS = false;
|
||||||
const LONG_LOOP_REPORT_TIME = 5;
|
const LONG_LOOP_REPORT_TIME = 5;
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ class ErrorHandler {
|
|||||||
*/
|
*/
|
||||||
public function init() {
|
public function init() {
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_RESTART_ON_EXCEPTION, true);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_RESTART_ON_EXCEPTION, true);
|
||||||
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_REPORT_ON_MANIACONTROLCOM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,7 +115,9 @@ class ErrorHandler {
|
|||||||
}
|
}
|
||||||
Logger::log($logMessage);
|
Logger::log($logMessage);
|
||||||
|
|
||||||
if (!DEV_MODE && !$isUserError && !$suppressed) {
|
$settingManager = $this->maniaControl->getSettingManager();
|
||||||
|
|
||||||
|
if (!DEV_MODE && !$isUserError && !$suppressed && (!$settingManager || $settingManager->getSettingValue($this, self::SETTING_REPORT_ON_MANIACONTROLCOM))) {
|
||||||
// Report error
|
// Report error
|
||||||
$report = array();
|
$report = array();
|
||||||
$report['Type'] = 'Error';
|
$report['Type'] = 'Error';
|
||||||
@ -472,7 +476,9 @@ class ErrorHandler {
|
|||||||
$logMessage = $message . PHP_EOL . 'Class: ' . $exceptionClass . PHP_EOL . 'Trace:' . PHP_EOL . $traceString;
|
$logMessage = $message . PHP_EOL . 'Class: ' . $exceptionClass . PHP_EOL . 'Trace:' . PHP_EOL . $traceString;
|
||||||
Logger::log($logMessage);
|
Logger::log($logMessage);
|
||||||
|
|
||||||
if (!DEV_MODE) {
|
$settingManager = $this->maniaControl->getSettingManager();
|
||||||
|
|
||||||
|
if (!DEV_MODE && (!$settingManager || $settingManager->getSettingValue($this, self::SETTING_REPORT_ON_MANIACONTROLCOM))) {
|
||||||
$report = array();
|
$report = array();
|
||||||
$report['Type'] = 'Exception';
|
$report['Type'] = 'Exception';
|
||||||
$report['Message'] = $message;
|
$report['Message'] = $message;
|
||||||
@ -503,7 +509,7 @@ class ErrorHandler {
|
|||||||
$report['ServerLogin'] = $server->login;
|
$report['ServerLogin'] = $server->login;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($settingManager = $this->maniaControl->getSettingManager()) && ($updateManager = $this->maniaControl->getUpdateManager())) {
|
if ($settingManager && ($updateManager = $this->maniaControl->getUpdateManager())) {
|
||||||
$report['UpdateChannel'] = $settingManager->getSettingValue($updateManager, $updateManager::SETTING_UPDATECHECK_CHANNEL);
|
$report['UpdateChannel'] = $settingManager->getSettingValue($updateManager, $updateManager::SETTING_UPDATECHECK_CHANNEL);
|
||||||
$report['ManiaControlVersion'] = ManiaControl::VERSION . ' #' . $updateManager->getBuildDate();
|
$report['ManiaControlVersion'] = ManiaControl::VERSION . ' #' . $updateManager->getBuildDate();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user