Only call sapi_windows_set_ctrl_handler() for CLI requests (#9771)
parent
44bb82b50f
commit
7652408829
|
@ -405,7 +405,7 @@ EOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// handler Ctrl+C for Windows on PHP 7.4+
|
// handler Ctrl+C for Windows on PHP 7.4+
|
||||||
if (function_exists('sapi_windows_set_ctrl_handler')) {
|
if (function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli') {
|
||||||
@mkdir($directory, 0777, true);
|
@mkdir($directory, 0777, true);
|
||||||
if ($realDir = realpath($directory)) {
|
if ($realDir = realpath($directory)) {
|
||||||
sapi_windows_set_ctrl_handler(function () use ($realDir) {
|
sapi_windows_set_ctrl_handler(function () use ($realDir) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ class InstallationManager
|
||||||
};
|
};
|
||||||
|
|
||||||
$handleInterruptsUnix = function_exists('pcntl_async_signals') && function_exists('pcntl_signal');
|
$handleInterruptsUnix = function_exists('pcntl_async_signals') && function_exists('pcntl_signal');
|
||||||
$handleInterruptsWindows = function_exists('sapi_windows_set_ctrl_handler');
|
$handleInterruptsWindows = function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli';
|
||||||
$prevHandler = null;
|
$prevHandler = null;
|
||||||
$windowsHandler = null;
|
$windowsHandler = null;
|
||||||
if ($handleInterruptsUnix) {
|
if ($handleInterruptsUnix) {
|
||||||
|
|
Loading…
Reference in New Issue