fix error when pcntl extension is not loaded
This commit is contained in:
parent
996dde826d
commit
f7b3fb5f71
@ -29,7 +29,9 @@ if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
|
||||
gc_enable();
|
||||
|
||||
// Listen process signals
|
||||
pcntl_async_signals(true);
|
||||
if (extension_loaded('pcntl')) {
|
||||
pcntl_async_signals(true);
|
||||
}
|
||||
|
||||
// Register AutoLoader
|
||||
require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php';
|
||||
|
@ -653,9 +653,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
||||
|
||||
try {
|
||||
// Manage SIGTERM signal
|
||||
if (extension_loaded('pcntl')) {
|
||||
pcntl_signal(SIGTERM, function() {
|
||||
$this->quit("Stop signal received from the OS.", false);
|
||||
});
|
||||
}
|
||||
|
||||
// Connect to server
|
||||
$this->connect();
|
||||
|
Loading…
Reference in New Issue
Block a user