|
108 | 108 | use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransportFactory;
|
109 | 109 | use Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\BeanstalkdTransportFactory;
|
110 | 110 | use Symfony\Component\Messenger\Bridge\Redis\Transport\RedisTransportFactory;
|
| 111 | +use Symfony\Component\Messenger\Command\StatsCommand; |
111 | 112 | use Symfony\Component\Messenger\Handler\BatchHandlerInterface;
|
112 | 113 | use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
113 | 114 | use Symfony\Component\Messenger\MessageBus;
|
@@ -503,6 +504,7 @@ public function load(array $configs, ContainerBuilder $container)
|
503 | 504 | $this->registerMessengerConfiguration($config['messenger'], $container, $loader, $config['validation']);
|
504 | 505 | } else {
|
505 | 506 | $container->removeDefinition('console.command.messenger_consume_messages');
|
| 507 | + $container->removeDefinition('console.command.messenger_stats'); |
506 | 508 | $container->removeDefinition('console.command.messenger_debug');
|
507 | 509 | $container->removeDefinition('console.command.messenger_stop_workers');
|
508 | 510 | $container->removeDefinition('console.command.messenger_setup_transports');
|
@@ -1966,6 +1968,10 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
|
1966 | 1968 | throw new LogicException('Messenger support cannot be enabled as the Messenger component is not installed. Try running "composer require symfony/messenger".');
|
1967 | 1969 | }
|
1968 | 1970 |
|
| 1971 | + if (!class_exists(StatsCommand::class)) { |
| 1972 | + $container->removeDefinition('console.command.messenger_stats'); |
| 1973 | + } |
| 1974 | + |
1969 | 1975 | $loader->load('messenger.php');
|
1970 | 1976 |
|
1971 | 1977 | if (!interface_exists(DenormalizerInterface::class)) {
|
|
0 commit comments