1
0
Fork 0

Add function_exists() for 'pcntl_signal'

pull/8921/head
Jean-Michel DELEHAYE 2020-05-07 10:14:37 +02:00 committed by Jordi Boggiano
parent ff27fdf4ea
commit 42fc372e52
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 2 additions and 2 deletions

View File

@ -362,7 +362,7 @@ EOT
} }
// handler Ctrl+C for unix-like systems // handler Ctrl+C for unix-like systems
if (function_exists('pcntl_async_signals')) { if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
@mkdir($directory, 0777, true); @mkdir($directory, 0777, true);
if ($realDir = realpath($directory)) { if ($realDir = realpath($directory)) {
pcntl_async_signals(true); pcntl_async_signals(true);

View File

@ -84,7 +84,7 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
if (function_exists('pcntl_async_signals')) { if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
pcntl_async_signals(true); pcntl_async_signals(true);
pcntl_signal(SIGINT, array($this, 'revertComposerFile')); pcntl_signal(SIGINT, array($this, 'revertComposerFile'));
pcntl_signal(SIGTERM, array($this, 'revertComposerFile')); pcntl_signal(SIGTERM, array($this, 'revertComposerFile'));