|
109 | 109 | use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransportFactory;
|
110 | 110 | use Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\BeanstalkdTransportFactory;
|
111 | 111 | use Symfony\Component\Messenger\Bridge\Redis\Transport\RedisTransportFactory;
|
| 112 | +use Symfony\Component\Messenger\Command\StatsCommand; |
112 | 113 | use Symfony\Component\Messenger\Handler\BatchHandlerInterface;
|
113 | 114 | use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
114 | 115 | use Symfony\Component\Messenger\MessageBus;
|
@@ -510,6 +511,7 @@ public function load(array $configs, ContainerBuilder $container)
|
510 | 511 | $this->registerMessengerConfiguration($config['messenger'], $container, $loader, $config['validation']);
|
511 | 512 | } else {
|
512 | 513 | $container->removeDefinition('console.command.messenger_consume_messages');
|
| 514 | + $container->removeDefinition('console.command.messenger_stats'); |
513 | 515 | $container->removeDefinition('console.command.messenger_debug');
|
514 | 516 | $container->removeDefinition('console.command.messenger_stop_workers');
|
515 | 517 | $container->removeDefinition('console.command.messenger_setup_transports');
|
@@ -1977,6 +1979,10 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
|
1977 | 1979 | throw new LogicException('Messenger support cannot be enabled as the Messenger component is not installed. Try running "composer require symfony/messenger".');
|
1978 | 1980 | }
|
1979 | 1981 |
|
| 1982 | + if (!class_exists(StatsCommand::class)) { |
| 1983 | + $container->removeDefinition('console.command.messenger_stats'); |
| 1984 | + } |
| 1985 | + |
1980 | 1986 | $loader->load('messenger.php');
|
1981 | 1987 |
|
1982 | 1988 | if (!interface_exists(DenormalizerInterface::class)) {
|
|
0 commit comments