fixed missing 'shutdown' message

This commit is contained in:
Steffen Schröder
2014-08-25 18:01:48 +02:00
parent 7a87fa5aa6
commit bdd82192bb
2 changed files with 20 additions and 22 deletions

View File

@ -390,26 +390,6 @@ class ErrorHandler {
* Handle PHP Process Shutdown
*/
public function handleShutdown() {
// TODO: skip client-related actions on transport exception (e.g. server down)
if ($this->maniaControl->getCallbackManager()) {
// OnShutdown callback
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::ONSHUTDOWN);
}
if ($this->maniaControl->getChat()) {
// Announce quit
$this->maniaControl->getChat()->sendInformation('ManiaControl shutting down.');
}
if ($this->maniaControl->getClient()) {
try {
$this->maniaControl->getClient()->sendHideManialinkPage();
} catch (TransportException $e) {
$this->handleException($e, false);
}
}
// Check if the Shutdown was caused by a Fatal Error and report it
$error = error_get_last();
if ($error && self::isFatalError($error['type'])) {