moved web service url constant to ManiaControl class
This commit is contained in:
		@@ -37,38 +37,38 @@ class ErrorHandler {
 | 
			
		||||
		$message .= "Trace: {$ex->getTraceAsString()}" . PHP_EOL;
 | 
			
		||||
		logMessage($message);
 | 
			
		||||
 | 
			
		||||
		$error = array();
 | 
			
		||||
		$error["Type"]            = "Exception";
 | 
			
		||||
		$error["Message"]         = $message;
 | 
			
		||||
		$error['OperatingSystem'] = php_uname();
 | 
			
		||||
		$error['PHPVersion']      = phpversion();
 | 
			
		||||
 | 
			
		||||
		if ($this->maniaControl->server != null) {
 | 
			
		||||
		if ($this->maniaControl->server) {
 | 
			
		||||
			$error['ServerLogin'] = $this->maniaControl->server->login;
 | 
			
		||||
		} else {
 | 
			
		||||
			$error['ServerLogin'] = null;
 | 
			
		||||
			$error['ServerLogin'] = '';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if ($this->maniaControl->settingManager != null && $this->maniaControl->updateManager != null) {
 | 
			
		||||
		if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
 | 
			
		||||
			$error['UpdateChannel']       = $this->maniaControl->settingManager->getSetting($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
 | 
			
		||||
			$error['ManiaControlVersion'] = $this->maniaControl->updateManager->getCurrentBuildDate();
 | 
			
		||||
		} else {
 | 
			
		||||
			$error['UpdateChannel']       = null;
 | 
			
		||||
			$error['UpdateChannel']       = '';
 | 
			
		||||
			$error['ManiaControlVersion'] = ManiaControl::VERSION;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$json = json_encode($error);
 | 
			
		||||
		$info = base64_encode($json);
 | 
			
		||||
 | 
			
		||||
		$url     = UpdateManager::URL_WEBSERVICE . "errorreport?error=" . urlencode($info);
 | 
			
		||||
		$url     = ManiaControl::URL_WEBSERVICE . "errorreport?error=" . urlencode($info);
 | 
			
		||||
		$success = FileUtil::loadFile($url);
 | 
			
		||||
 | 
			
		||||
		if (!json_decode($success)) {
 | 
			
		||||
			logMessage("Exception-Report failed");
 | 
			
		||||
			logMessage("Exception-Report failed!");
 | 
			
		||||
		} else {
 | 
			
		||||
			logMessage("Exception successfully reported!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		$this->maniaControl->restart();
 | 
			
		||||
		exit();
 | 
			
		||||
	}
 | 
			
		||||
@@ -87,6 +87,7 @@ class ErrorHandler {
 | 
			
		||||
			// Error suppressed
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// Log error
 | 
			
		||||
		$errorTag = $this->getErrorTag($errorNumber);
 | 
			
		||||
		$message  = "{$errorTag}: {$errorString} in File '{$errorFile}' on Line {$errorLine}!";
 | 
			
		||||
@@ -116,7 +117,7 @@ class ErrorHandler {
 | 
			
		||||
			$json = json_encode($error);
 | 
			
		||||
			$info = base64_encode($json);
 | 
			
		||||
 | 
			
		||||
			$url     = UpdateManager::URL_WEBSERVICE . "errorreport?error=" . urlencode($info);
 | 
			
		||||
			$url     = ManiaControl::URL_WEBSERVICE . "errorreport?error=" . urlencode($info);
 | 
			
		||||
			$success = FileUtil::loadFile($url);
 | 
			
		||||
 | 
			
		||||
			if (!json_decode($success)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user