mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-08 03:52:12 +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()
|
function shutdown()
|
||||||
{
|
{
|
||||||
|
@ -149,10 +170,6 @@ 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");
|
||||||
|
@ -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
|
// {{{ main
|
||||||
|
|
||||||
|
if (false === check_required_extensions())
|
||||||
|
return 1;
|
||||||
|
|
||||||
set_up_screen();
|
set_up_screen();
|
||||||
load_settings($mm);
|
load_settings($mm);
|
||||||
clear();
|
clear();
|
||||||
|
|
Loading…
Reference in a new issue