errorhandler improvement
This commit is contained in:
		
				
					committed by
					
						
						Steffen Schröder
					
				
			
			
				
	
			
			
			
						parent
						
							9d56ed209a
						
					
				
				
					commit
					e1eeee1e4c
				
			@@ -37,18 +37,25 @@ class ErrorHandler {
 | 
			
		||||
		$message .= "Trace: {$ex->getTraceAsString()}" . PHP_EOL;
 | 
			
		||||
		logMessage($message);
 | 
			
		||||
 | 
			
		||||
		$error                        = array();
 | 
			
		||||
		$error["Type"]            = "Exception";
 | 
			
		||||
		$error["Message"]         = $message;
 | 
			
		||||
		$error['ManiaControlVersion'] = ManiaControl::VERSION;
 | 
			
		||||
		$error['OperatingSystem'] = php_uname();
 | 
			
		||||
		$error['PHPVersion']      = phpversion();
 | 
			
		||||
 | 
			
		||||
		if ($this->maniaControl->server != null) {
 | 
			
		||||
			$error['ServerLogin'] = $this->maniaControl->server->login;
 | 
			
		||||
		} else {
 | 
			
		||||
			$error['ServerLogin'] = null;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if ($this->maniaControl->settingManager != null && $this->maniaControl->updateManager != null) {
 | 
			
		||||
			$error['UpdateChannel']       = $this->maniaControl->settingManager->getSetting($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
 | 
			
		||||
			$error['ManiaControlVersion'] = $this->maniaControl->updateManager->getCurrentBuildDate();
 | 
			
		||||
		} else {
 | 
			
		||||
			$error['UpdateChannel']       = null;
 | 
			
		||||
			$error['ManiaControlVersion'] = ManiaControl::VERSION;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$json = json_encode($error);
 | 
			
		||||
		$info = base64_encode($json);
 | 
			
		||||
 | 
			
		||||
@@ -89,15 +96,23 @@ class ErrorHandler {
 | 
			
		||||
			$error                    = array();
 | 
			
		||||
			$error["Type"]            = "Error";
 | 
			
		||||
			$error["Message"]         = $message;
 | 
			
		||||
			$error['ManiaControlVersion'] = ManiaControl::VERSION;
 | 
			
		||||
			$error['OperatingSystem'] = php_uname();
 | 
			
		||||
			$error['PHPVersion']      = phpversion();
 | 
			
		||||
			
 | 
			
		||||
			if ($this->maniaControl->server != null) {
 | 
			
		||||
				$error['ServerLogin'] = $this->maniaControl->server->login;
 | 
			
		||||
			} else {
 | 
			
		||||
				$error['ServerLogin'] = null;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if ($this->maniaControl->settingManager != null && $this->maniaControl->updateManager != null) {
 | 
			
		||||
				$error['UpdateChannel']       = $this->maniaControl->settingManager->getSetting($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
 | 
			
		||||
				$error['ManiaControlVersion'] = $this->maniaControl->updateManager->getCurrentBuildDate();
 | 
			
		||||
			} else {
 | 
			
		||||
				$error['UpdateChannel']       = null;
 | 
			
		||||
				$error['ManiaControlVersion'] = ManiaControl::VERSION;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			$json = json_encode($error);
 | 
			
		||||
			$info = base64_encode($json);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -225,6 +225,15 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
 | 
			
		||||
		return $fileContent;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Get the CurrentBuildDate
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return string
 | 
			
		||||
	 */
 | 
			
		||||
	public function getCurrentBuildDate() {
 | 
			
		||||
		return $this->currentBuildDate;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Set the Build Date of the local Nightly Build Version
 | 
			
		||||
	 *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user