2020-03-14 22:19:16 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-04-12 14:59:10 +03:00
|
|
|
use Laminas\ServiceManager\Proxy\LazyServiceFactory;
|
|
|
|
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
2021-04-02 10:46:02 +03:00
|
|
|
use Symfony\Component\Mercure\Hub;
|
|
|
|
use Symfony\Component\Mercure\HubInterface;
|
2020-04-12 14:59:10 +03:00
|
|
|
|
2021-08-07 12:05:20 +03:00
|
|
|
use function Shlinkio\Shlink\Common\env;
|
|
|
|
|
|
|
|
return (static function (): array {
|
|
|
|
$publicUrl = env('MERCURE_PUBLIC_HUB_URL');
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'mercure' => [
|
|
|
|
'public_hub_url' => $publicUrl,
|
|
|
|
'internal_hub_url' => env('MERCURE_INTERNAL_HUB_URL', $publicUrl),
|
|
|
|
'jwt_secret' => env('MERCURE_JWT_SECRET'),
|
|
|
|
'jwt_issuer' => 'Shlink',
|
2020-04-12 14:59:10 +03:00
|
|
|
],
|
2021-08-07 12:05:20 +03:00
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'delegators' => [
|
|
|
|
LcobucciJwtProvider::class => [
|
|
|
|
LazyServiceFactory::class,
|
|
|
|
],
|
|
|
|
Hub::class => [
|
|
|
|
LazyServiceFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'lazy_services' => [
|
|
|
|
'class_map' => [
|
|
|
|
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
|
|
|
|
Hub::class => HubInterface::class,
|
|
|
|
],
|
2020-04-12 14:59:10 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2021-08-07 12:05:20 +03:00
|
|
|
];
|
|
|
|
})();
|