fix error when pcntl extension is not loaded

This commit is contained in:
Beu
2023-12-23 21:10:31 +01:00
parent 996dde826d
commit f7b3fb5f71
2 changed files with 8 additions and 4 deletions

View File

@ -653,9 +653,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
try {
// Manage SIGTERM signal
pcntl_signal(SIGTERM, function() {
$this->quit("Stop signal received from the OS.", false);
});
if (extension_loaded('pcntl')) {
pcntl_signal(SIGTERM, function() {
$this->quit("Stop signal received from the OS.", false);
});
}
// Connect to server
$this->connect();