diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 0e98d9bdd53cd..0efccdb103002 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -110,6 +110,10 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader) public function getSignalRegistry(): SignalRegistry { + if (!$this->signalRegistry) { + throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + } + return $this->signalRegistry; } @@ -282,7 +286,7 @@ public function doRun(InputInterface $input, OutputInterface $output) $command = $this->find($alternative); } - if ($this->dispatcher) { + if ($this->dispatcher && $this->signalRegistry) { foreach ($this->signalsToDispatchEvent as $signal) { $event = new ConsoleSignalEvent($command, $input, $output, $signal); @@ -954,7 +958,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } if ($command instanceof SignalableCommandInterface) { - if (!$this->signalsToDispatchEvent) { + if (!$this->signalRegistry) { throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } foreach ($command->getSubscribedSignals() as $signal) {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: