mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-05-17 22:46:32 +02:00
just a little rearranging
This commit is contained in:
parent
5f2dee1e2d
commit
56fbe47009
47
h-m-m
47
h-m-m
|
@ -139,8 +139,29 @@ const collapsed_symbol_off = "\033[0m";
|
|||
|
||||
|
||||
// }}}
|
||||
// {{{ alternative screen
|
||||
// {{{ checking the required extensions
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ alternative screen
|
||||
|
||||
function shutdown()
|
||||
{
|
||||
|
@ -149,10 +170,6 @@ function shutdown()
|
|||
exit;
|
||||
}
|
||||
|
||||
if (false === check_required_extensions()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
register_shutdown_function("shutdown");
|
||||
declare(ticks = 1);
|
||||
pcntl_signal(SIGINT,"shutdown");
|
||||
|
@ -2424,26 +2441,12 @@ 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
|
||||
|
||||
if (false === check_required_extensions())
|
||||
return 1;
|
||||
|
||||
set_up_screen();
|
||||
load_settings($mm);
|
||||
clear();
|
||||
|
|
Loading…
Reference in a new issue