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();
|
gc_enable();
|
||||||
|
|
||||||
// Listen process signals
|
// Listen process signals
|
||||||
|
if (extension_loaded('pcntl')) {
|
||||||
pcntl_async_signals(true);
|
pcntl_async_signals(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Register AutoLoader
|
// Register AutoLoader
|
||||||
require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php';
|
require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php';
|
||||||
|
@ -653,9 +653,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Manage SIGTERM signal
|
// Manage SIGTERM signal
|
||||||
|
if (extension_loaded('pcntl')) {
|
||||||
pcntl_signal(SIGTERM, function() {
|
pcntl_signal(SIGTERM, function() {
|
||||||
$this->quit("Stop signal received from the OS.", false);
|
$this->quit("Stop signal received from the OS.", false);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Connect to server
|
// Connect to server
|
||||||
$this->connect();
|
$this->connect();
|
||||||
|
Loading…
Reference in New Issue
Block a user