mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 15:25:36 +08:00
Fix Windows missing SIGINT bug
This commit is contained in:
@@ -148,10 +148,13 @@ class CraftCommand extends BaseCommand
|
|||||||
|
|
||||||
if (PHP_OS_FAMILY === 'Windows') {
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
sapi_windows_set_ctrl_handler(function () use ($process) {
|
sapi_windows_set_ctrl_handler(function () use ($process) {
|
||||||
$process->signal(SIGINT);
|
if ($process->isRunning()) {
|
||||||
|
$process->signal(-1073741510);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} elseif (extension_loaded('pcntl')) {
|
} elseif (extension_loaded('pcntl')) {
|
||||||
pcntl_signal(SIGINT, function () use ($process) {
|
pcntl_signal(SIGINT, function () use ($process) {
|
||||||
|
/* @noinspection PhpComposerExtensionStubsInspection */
|
||||||
$process->signal(SIGINT);
|
$process->signal(SIGINT);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user