mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-03 03:02:12 +02:00
Merge pull request #2 from Wojciechem/main
fix: check that required extensions are enabled. Resolves #1
This commit is contained in:
commit
5f2dee1e2d
21
h-m-m
21
h-m-m
|
@ -149,6 +149,10 @@ function shutdown()
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (false === check_required_extensions()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
register_shutdown_function("shutdown");
|
register_shutdown_function("shutdown");
|
||||||
declare(ticks = 1);
|
declare(ticks = 1);
|
||||||
pcntl_signal(SIGINT,"shutdown");
|
pcntl_signal(SIGINT,"shutdown");
|
||||||
|
@ -2420,6 +2424,23 @@ function monitor_key_presses(&$mm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_required_extensions(): bool
|
||||||
|
{
|
||||||
|
if (!function_exists('pcntl_signal')) {
|
||||||
|
echo 'Required extension pcntl is not enabled; please check your php installation!';
|
||||||
|
echo PHP_EOL;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('mb_strlen')) {
|
||||||
|
echo 'Required extension mbstring is not enabled; please check your php installation!';
|
||||||
|
echo PHP_EOL;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
// {{{ main
|
// {{{ main
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue