2021-12-11 19:07:40 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
use Laminas\ServiceManager\Proxy\LazyServiceFactory;
|
|
|
|
use PhpAmqpLib\Connection\AMQPStreamConnection;
|
2022-01-20 22:16:37 +03:00
|
|
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
2021-12-11 19:07:40 +03:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
2021-12-12 12:32:57 +03:00
|
|
|
'rabbitmq' => [
|
2022-01-20 22:16:37 +03:00
|
|
|
'enabled' => (bool) EnvVars::RABBITMQ_ENABLED()->loadFromEnv(false),
|
|
|
|
'host' => EnvVars::RABBITMQ_HOST()->loadFromEnv(),
|
|
|
|
'port' => (int) EnvVars::RABBITMQ_PORT()->loadFromEnv('5672'),
|
|
|
|
'user' => EnvVars::RABBITMQ_USER()->loadFromEnv(),
|
|
|
|
'password' => EnvVars::RABBITMQ_PASSWORD()->loadFromEnv(),
|
|
|
|
'vhost' => EnvVars::RABBITMQ_VHOST()->loadFromEnv('/'),
|
2021-12-11 19:07:40 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'factories' => [
|
|
|
|
AMQPStreamConnection::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
|
|
|
'delegators' => [
|
|
|
|
AMQPStreamConnection::class => [
|
|
|
|
LazyServiceFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'lazy_services' => [
|
|
|
|
'class_map' => [
|
|
|
|
AMQPStreamConnection::class => AMQPStreamConnection::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
|
|
|
AMQPStreamConnection::class => [
|
2021-12-12 12:32:57 +03:00
|
|
|
'config.rabbitmq.host',
|
|
|
|
'config.rabbitmq.port',
|
|
|
|
'config.rabbitmq.user',
|
|
|
|
'config.rabbitmq.password',
|
|
|
|
'config.rabbitmq.vhost',
|
2021-12-11 19:07:40 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|