Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42fc372

Browse files
Jean-Michel DELEHAYESeldaek
authored andcommitted
Add function_exists() for 'pcntl_signal'
1 parent ff27fdf commit 42fc372

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Composer/Command/CreateProjectCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
362362
}
363363

364364
// handler Ctrl+C for unix-like systems
365-
if (function_exists('pcntl_async_signals')) {
365+
if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
366366
@mkdir($directory, 0777, true);
367367
if ($realDir = realpath($directory)) {
368368
pcntl_async_signals(true);

src/Composer/Command/RequireCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function configure()
8484

8585
protected function execute(InputInterface $input, OutputInterface $output)
8686
{
87-
if (function_exists('pcntl_async_signals')) {
87+
if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
8888
pcntl_async_signals(true);
8989
pcntl_signal(SIGINT, array($this, 'revertComposerFile'));
9090
pcntl_signal(SIGTERM, array($this, 'revertComposerFile'));

0 commit comments

Comments
 (0)