2016-07-19 10:07:59 -05:00
|
|
|
<?php
|
2019-10-05 10:26:10 -05:00
|
|
|
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
2017-07-22 07:20:40 -05:00
|
|
|
|
2018-09-20 13:27:34 -05:00
|
|
|
namespace Shlinkio\Shlink\Rest;
|
|
|
|
|
2020-01-01 14:11:53 -06:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
use Laminas\ServiceManager\Factory\InvokableFactory;
|
|
|
|
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
2017-07-22 07:20:40 -05:00
|
|
|
use Psr\Log\LoggerInterface;
|
2020-04-12 06:59:10 -05:00
|
|
|
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
2017-07-22 07:20:40 -05:00
|
|
|
use Shlinkio\Shlink\Core\Options\AppOptions;
|
|
|
|
use Shlinkio\Shlink\Core\Service;
|
|
|
|
use Shlinkio\Shlink\Rest\Service\ApiKeyService;
|
2016-07-19 10:07:59 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 09:30:05 -05:00
|
|
|
'dependencies' => [
|
2016-07-19 10:07:59 -05:00
|
|
|
'factories' => [
|
2017-07-22 07:20:40 -05:00
|
|
|
ApiKeyService::class => ConfigAbstractFactory::class,
|
|
|
|
|
2019-11-20 13:18:21 -06:00
|
|
|
Action\HealthAction::class => ConfigAbstractFactory::class,
|
2020-04-12 07:19:51 -05:00
|
|
|
Action\MercureInfoAction::class => ConfigAbstractFactory::class,
|
2018-09-20 12:55:24 -05:00
|
|
|
Action\ShortUrl\CreateShortUrlAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\EditShortUrlAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\DeleteShortUrlAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\ResolveShortUrlAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\ListShortUrlsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\EditShortUrlTagsAction::class => ConfigAbstractFactory::class,
|
2020-05-01 04:17:07 -05:00
|
|
|
Action\Visit\ShortUrlVisitsAction::class => ConfigAbstractFactory::class,
|
2017-07-22 07:20:40 -05:00
|
|
|
Action\Tag\ListTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\DeleteTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\CreateTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\UpdateTagAction::class => ConfigAbstractFactory::class,
|
|
|
|
|
2019-08-11 07:02:25 -05:00
|
|
|
ImplicitOptionsMiddleware::class => Middleware\EmptyResponseImplicitOptionsMiddlewareFactory::class,
|
2017-07-22 07:20:40 -05:00
|
|
|
Middleware\BodyParserMiddleware::class => InvokableFactory::class,
|
2016-07-19 10:07:59 -05:00
|
|
|
Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
|
2018-09-20 13:00:53 -05:00
|
|
|
Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class => InvokableFactory::class,
|
2020-02-08 05:22:07 -06:00
|
|
|
Middleware\ShortUrl\DropDefaultDomainFromRequestMiddleware::class => ConfigAbstractFactory::class,
|
2020-02-18 12:21:34 -06:00
|
|
|
Middleware\ShortUrl\DefaultShortCodesLengthMiddleware::class => ConfigAbstractFactory::class,
|
2017-07-22 07:20:40 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
|
|
|
ApiKeyService::class => ['em'],
|
|
|
|
|
2020-04-25 12:58:49 -05:00
|
|
|
Action\HealthAction::class => ['em', AppOptions::class, 'Logger_Shlink'],
|
2020-04-12 07:19:51 -05:00
|
|
|
Action\MercureInfoAction::class => [LcobucciJwtProvider::class, 'config.mercure', 'Logger_Shlink'],
|
2018-09-20 12:55:24 -05:00
|
|
|
Action\ShortUrl\CreateShortUrlAction::class => [
|
2017-07-22 07:20:40 -05:00
|
|
|
Service\UrlShortener::class,
|
|
|
|
'config.url_shortener.domain',
|
2017-10-12 03:13:20 -05:00
|
|
|
'Logger_Shlink',
|
2016-07-19 10:07:59 -05:00
|
|
|
],
|
2018-09-20 12:55:24 -05:00
|
|
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
2018-05-03 06:21:43 -05:00
|
|
|
Service\UrlShortener::class,
|
|
|
|
ApiKeyService::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-11-18 09:28:04 -06:00
|
|
|
Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
|
|
|
Action\ShortUrl\DeleteShortUrlAction::class => [Service\ShortUrl\DeleteShortUrlService::class, 'Logger_Shlink'],
|
2020-01-26 12:21:51 -06:00
|
|
|
Action\ShortUrl\ResolveShortUrlAction::class => [
|
|
|
|
Service\ShortUrl\ShortUrlResolver::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
],
|
2020-05-01 04:17:07 -05:00
|
|
|
Action\Visit\ShortUrlVisitsAction::class => [Service\VisitsTracker::class, 'Logger_Shlink'],
|
2018-09-20 12:55:24 -05:00
|
|
|
Action\ShortUrl\ListShortUrlsAction::class => [
|
2018-08-10 16:14:45 -05:00
|
|
|
Service\ShortUrlService::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-11-18 09:28:04 -06:00
|
|
|
Action\ShortUrl\EditShortUrlTagsAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
2017-07-22 07:20:40 -05:00
|
|
|
Action\Tag\ListTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
|
|
Action\Tag\DeleteTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
|
|
Action\Tag\CreateTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
2018-11-18 09:28:04 -06:00
|
|
|
Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
2020-02-02 12:03:43 -06:00
|
|
|
|
2020-02-08 05:22:07 -06:00
|
|
|
Middleware\ShortUrl\DropDefaultDomainFromRequestMiddleware::class => ['config.url_shortener.domain.hostname'],
|
2020-02-18 12:21:34 -06:00
|
|
|
Middleware\ShortUrl\DefaultShortCodesLengthMiddleware::class => [
|
|
|
|
'config.url_shortener.default_short_codes_length',
|
|
|
|
],
|
2016-07-19 10:07:59 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|