From 42fc372e5208522fc8bafafde916a455c53807d6 Mon Sep 17 00:00:00 2001 From: Jean-Michel DELEHAYE Date: Thu, 7 May 2020 10:14:37 +0200 Subject: [PATCH] Add function_exists() for 'pcntl_signal' --- src/Composer/Command/CreateProjectCommand.php | 2 +- src/Composer/Command/RequireCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 1801583fd..067fb9a40 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -362,7 +362,7 @@ EOT } // 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); if ($realDir = realpath($directory)) { pcntl_async_signals(true); diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index cbdfdaf9c..9b59e7feb 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -84,7 +84,7 @@ EOT 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_signal(SIGINT, array($this, 'revertComposerFile')); pcntl_signal(SIGTERM, array($this, 'revertComposerFile'));