Skip to content

Commit 53a4b41

Browse files
authored
fix: signal trait (#9846)
1 parent 3d993c5 commit 53a4b41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

system/CLI/SignalTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ protected function isPosixAvailable(): bool
9595
* @param array<int, string> $methodMap Optional signal-to-method mapping
9696
*/
9797
protected function registerSignals(
98-
array $signals = [SIGTERM, SIGINT, SIGHUP, SIGQUIT],
98+
array $signals = [],
9999
array $methodMap = [],
100100
): void {
101101
if (! $this->isPcntlAvailable()) {
102102
return;
103103
}
104104

105+
if ($signals === []) {
106+
$signals = [SIGTERM, SIGINT, SIGHUP, SIGQUIT];
107+
}
108+
105109
if (! $this->isPosixAvailable() && (in_array(SIGTSTP, $signals, true) || in_array(SIGCONT, $signals, true))) {
106110
CLI::write(lang('CLI.signals.noPosixExtension'), 'yellow');
107111
$signals = array_diff($signals, [SIGTSTP, SIGCONT]);

0 commit comments

Comments
 (0)