2016-07-19 17:07:59 +02:00
|
|
|
<?php
|
2017-10-12 10:13:20 +02:00
|
|
|
declare(strict_types=1);
|
2017-07-22 14:20:40 +02:00
|
|
|
|
2018-09-20 20:27:34 +02:00
|
|
|
namespace Shlinkio\Shlink\Rest;
|
|
|
|
|
2017-07-22 14:20:40 +02:00
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
use Shlinkio\Shlink\Core\Options\AppOptions;
|
|
|
|
use Shlinkio\Shlink\Core\Service;
|
|
|
|
use Shlinkio\Shlink\Rest\Service\ApiKeyService;
|
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2016-07-19 17:07:59 +02:00
|
|
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 16:30:05 +02:00
|
|
|
'dependencies' => [
|
2016-07-19 17:07:59 +02:00
|
|
|
'factories' => [
|
2018-09-20 20:27:34 +02:00
|
|
|
Authentication\JWTService::class => ConfigAbstractFactory::class,
|
2017-07-22 14:20:40 +02:00
|
|
|
ApiKeyService::class => ConfigAbstractFactory::class,
|
|
|
|
|
|
|
|
Action\AuthenticateAction::class => ConfigAbstractFactory::class,
|
2018-12-23 10:18:38 +01:00
|
|
|
Action\HealthAction::class => Action\HealthActionFactory::class,
|
2018-09-20 19:55:24 +02: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,
|
2018-05-03 18:04:00 +02:00
|
|
|
Action\Visit\GetVisitsAction::class => ConfigAbstractFactory::class,
|
2018-09-20 19:55:24 +02:00
|
|
|
Action\ShortUrl\ListShortUrlsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\ShortUrl\EditShortUrlTagsAction::class => ConfigAbstractFactory::class,
|
2017-07-22 14:20:40 +02: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,
|
|
|
|
|
|
|
|
Middleware\BodyParserMiddleware::class => InvokableFactory::class,
|
2016-07-19 17:07:59 +02:00
|
|
|
Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
|
2016-10-22 18:46:53 +02:00
|
|
|
Middleware\PathVersionMiddleware::class => InvokableFactory::class,
|
2018-09-20 20:00:53 +02:00
|
|
|
Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class => InvokableFactory::class,
|
2018-09-20 20:27:34 +02:00
|
|
|
Middleware\ShortUrl\ShortCodePathMiddleware::class => InvokableFactory::class,
|
2017-07-22 14:20:40 +02:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2018-09-20 20:27:34 +02:00
|
|
|
Authentication\JWTService::class => [AppOptions::class],
|
2017-07-22 14:20:40 +02:00
|
|
|
ApiKeyService::class => ['em'],
|
|
|
|
|
2018-11-18 16:28:04 +01:00
|
|
|
Action\AuthenticateAction::class => [ApiKeyService::class, Authentication\JWTService::class, 'Logger_Shlink'],
|
2018-09-20 19:55:24 +02:00
|
|
|
Action\ShortUrl\CreateShortUrlAction::class => [
|
2017-07-22 14:20:40 +02:00
|
|
|
Service\UrlShortener::class,
|
|
|
|
'config.url_shortener.domain',
|
2017-10-12 10:13:20 +02:00
|
|
|
'Logger_Shlink',
|
2016-07-19 17:07:59 +02:00
|
|
|
],
|
2018-09-20 19:55:24 +02:00
|
|
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
2018-05-03 13:21:43 +02:00
|
|
|
Service\UrlShortener::class,
|
|
|
|
ApiKeyService::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-11-18 16:28:04 +01:00
|
|
|
Action\ShortUrl\EditShortUrlAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
|
|
|
Action\ShortUrl\DeleteShortUrlAction::class => [Service\ShortUrl\DeleteShortUrlService::class, 'Logger_Shlink'],
|
|
|
|
Action\ShortUrl\ResolveShortUrlAction::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
|
|
|
|
Action\Visit\GetVisitsAction::class => [Service\VisitsTracker::class, 'Logger_Shlink'],
|
2018-09-20 19:55:24 +02:00
|
|
|
Action\ShortUrl\ListShortUrlsAction::class => [
|
2018-08-10 23:14:45 +02:00
|
|
|
Service\ShortUrlService::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-11-18 16:28:04 +01:00
|
|
|
Action\ShortUrl\EditShortUrlTagsAction::class => [Service\ShortUrlService::class, 'Logger_Shlink'],
|
2017-07-22 14:20:40 +02: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 16:28:04 +01:00
|
|
|
Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
2016-07-19 17:07:59 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|