File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,8 +18,17 @@ if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader
1818 );
1919}
2020
21+ if (!PHPPM \pcntl_installed ()) {
22+ die (
23+ sprintf (
24+ 'PCNTL is not enabled in the PHP installation at %s. See: http://php.net/manual/en/pcntl.installation.php ' ,
25+ PHP_BINARY
26+ )
27+ );
28+ }
29+
2130if (!PHPPM \pcntl_enabled ()) {
22- die ('Some of required pcntl functions are disabled. Check `disable_functions` setting in `php.ini`. ' );
31+ die ('Some required PCNTL functions are disabled. Check `disabled_functions` in `php.ini`. ' );
2332}
2433
2534use Symfony \Component \Console \Application ;
Original file line number Diff line number Diff line change @@ -1095,9 +1095,20 @@ protected function newSlaveInstance($port)
10951095require_once file_exists( $ dir . '/vendor/autoload.php')
10961096 ? $ dir . '/vendor/autoload.php'
10971097 : $ dir . '/../../autoload.php';
1098+
1099+ if (!pcntl_installed()) {
1100+ error_log(
1101+ sprintf(
1102+ 'PCNTL is not enabled in the PHP installation at %s. See: http://php.net/manual/en/pcntl.installation.php',
1103+ PHP_BINARY
1104+ )
1105+ );
1106+ exit();
1107+ }
10981108
10991109if (!pcntl_enabled()) {
1100- throw new \RuntimeException('Some of required pcntl functions are disabled. Check `disable_functions` setting in `php.ini`.');
1110+ error_log('Some required PCNTL functions are disabled. Check `disabled_functions` in `php.ini`.');
1111+ exit();
11011112}
11021113
11031114//global for all global functions
Original file line number Diff line number Diff line change @@ -30,7 +30,17 @@ function console_log($expression, $_ = null)
3030}
3131
3232/**
33- * Checks that all required pcntl functions are available, so not fatal errors would be cause in runtime
33+ * Checks that PCNTL is actually enabled in this installation.
34+ *
35+ * @return bool
36+ */
37+ function pcntl_installed ()
38+ {
39+ return function_exists ('pcntl_signal ' );
40+ }
41+
42+ /**
43+ * Makes sure required PCNTL functions aren't included in disable_functions.
3444 *
3545 * @return bool
3646 */
You can’t perform that action at this time.
0 commit comments