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+
|
||||
if (function_exists('sapi_windows_set_ctrl_handler')) {
|
||||
if (function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli') {
|
||||
@mkdir($directory, 0777, true);
|
||||
if ($realDir = realpath($directory)) {
|
||||
sapi_windows_set_ctrl_handler(function () use ($realDir) {
|
||||
|
|
|
@ -208,7 +208,7 @@ class InstallationManager
|
|||
};
|
||||
|
||||
$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;
|
||||
$windowsHandler = null;
|
||||
if ($handleInterruptsUnix) {
|
||||
|
|
Loading…
Reference in New Issue