This commit is contained in:
the-djmaze 2023-05-31 21:44:51 +02:00
parent 3c28bc6b97
commit 9eaa0f4eb5

View file

@ -75,7 +75,7 @@ class Logger extends \SplFixedArray
if (\is_callable('pcntl_signal')) { if (\is_callable('pcntl_signal')) {
\pcntl_async_signals(true); \pcntl_async_signals(true);
foreach (static::$SIGNALS as $SIGNAL) { foreach (static::$SIGNALS as $SIGNAL) {
\pcntl_signal(\constant($SIGNAL), [$this, 'signalHandler']); \defined($SIGNAL) && \pcntl_signal(\constant($SIGNAL), [$this, 'signalHandler']);
} }
} }
} }
@ -209,7 +209,7 @@ class Logger extends \SplFixedArray
} }
if ($this->bUsed) { if ($this->bUsed) {
foreach (static::$SIGNALS as $SIGNAL) { foreach (static::$SIGNALS as $SIGNAL) {
if (\constant($SIGNAL) == $signo) { if (\defined($SIGNAL) && \constant($SIGNAL) == $signo) {
$this->Write("Caught {$SIGNAL}"); $this->Write("Caught {$SIGNAL}");
break; break;
} }