2016-07-19 10:17:37 -05:00
|
|
|
<?php
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
2017-07-22 06:33:32 -05:00
|
|
|
|
2018-09-29 02:52:32 -05:00
|
|
|
namespace Shlinkio\Shlink\CLI;
|
|
|
|
|
2019-04-14 04:19:21 -05:00
|
|
|
use GeoIp2\Database\Reader;
|
|
|
|
use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
|
2018-11-12 13:06:12 -06:00
|
|
|
use Shlinkio\Shlink\Common\IpGeolocation\GeoLite2\DbUpdater;
|
2018-11-11 05:44:57 -06:00
|
|
|
use Shlinkio\Shlink\Common\IpGeolocation\IpLocationResolverInterface;
|
2017-07-22 06:33:32 -05:00
|
|
|
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
|
|
|
|
use Shlinkio\Shlink\Core\Service;
|
|
|
|
use Shlinkio\Shlink\Rest\Service\ApiKeyService;
|
2016-08-01 14:11:42 -05:00
|
|
|
use Symfony\Component\Console\Application;
|
2018-11-17 07:10:38 -06:00
|
|
|
use Symfony\Component\Lock;
|
2017-07-22 06:33:32 -05:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2018-11-18 09:02:52 -06:00
|
|
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
2016-07-19 10:17:37 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 09:30:05 -05:00
|
|
|
'dependencies' => [
|
2016-07-19 10:17:37 -05:00
|
|
|
'factories' => [
|
2018-09-29 02:52:32 -05:00
|
|
|
Application::class => Factory\ApplicationFactory::class,
|
2016-07-19 10:17:37 -05:00
|
|
|
|
2019-04-14 04:19:21 -05:00
|
|
|
GeolocationDbUpdater::class => ConfigAbstractFactory::class,
|
|
|
|
|
2018-09-16 11:36:02 -05:00
|
|
|
Command\ShortUrl\GenerateShortUrlCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\ShortUrl\ResolveUrlCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\ShortUrl\ListShortUrlsCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\ShortUrl\GetVisitsCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\ShortUrl\GeneratePreviewCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\ShortUrl\DeleteShortUrlCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2019-04-14 02:10:00 -05:00
|
|
|
Command\Visit\LocateVisitsCommand::class => ConfigAbstractFactory::class,
|
2018-11-12 13:06:12 -06:00
|
|
|
Command\Visit\UpdateDbCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2018-11-18 09:02:52 -06:00
|
|
|
Command\Config\GenerateCharsetCommand::class => InvokableFactory::class,
|
|
|
|
Command\Config\GenerateSecretCommand::class => InvokableFactory::class,
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2017-07-22 06:33:32 -05:00
|
|
|
Command\Api\GenerateKeyCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Api\DisableKeyCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Api\ListKeysCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2017-07-22 06:33:32 -05:00
|
|
|
Command\Tag\ListTagsCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Tag\CreateTagCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Tag\RenameTagCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Tag\DeleteTagsCommand::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2019-04-14 04:19:21 -05:00
|
|
|
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class],
|
|
|
|
|
2018-11-18 09:02:52 -06:00
|
|
|
Command\ShortUrl\GenerateShortUrlCommand::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
|
|
|
|
Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class],
|
|
|
|
Command\ShortUrl\ListShortUrlsCommand::class => [Service\ShortUrlService::class, 'config.url_shortener.domain'],
|
|
|
|
Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class],
|
|
|
|
Command\ShortUrl\GeneratePreviewCommand::class => [Service\ShortUrlService::class, PreviewGenerator::class],
|
|
|
|
Command\ShortUrl\DeleteShortUrlCommand::class => [Service\ShortUrl\DeleteShortUrlService::class],
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2019-04-14 02:10:00 -05:00
|
|
|
Command\Visit\LocateVisitsCommand::class => [
|
2017-07-22 06:33:32 -05:00
|
|
|
Service\VisitService::class,
|
2018-11-11 05:40:40 -06:00
|
|
|
IpLocationResolverInterface::class,
|
2018-11-17 07:10:38 -06:00
|
|
|
Lock\Factory::class,
|
2016-07-19 10:17:37 -05:00
|
|
|
],
|
2018-11-18 09:02:52 -06:00
|
|
|
Command\Visit\UpdateDbCommand::class => [DbUpdater::class],
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2018-11-18 09:02:52 -06:00
|
|
|
Command\Api\GenerateKeyCommand::class => [ApiKeyService::class],
|
|
|
|
Command\Api\DisableKeyCommand::class => [ApiKeyService::class],
|
|
|
|
Command\Api\ListKeysCommand::class => [ApiKeyService::class],
|
2018-09-15 10:57:12 -05:00
|
|
|
|
2018-11-18 09:02:52 -06:00
|
|
|
Command\Tag\ListTagsCommand::class => [Service\Tag\TagService::class],
|
|
|
|
Command\Tag\CreateTagCommand::class => [Service\Tag\TagService::class],
|
|
|
|
Command\Tag\RenameTagCommand::class => [Service\Tag\TagService::class],
|
|
|
|
Command\Tag\DeleteTagsCommand::class => [Service\Tag\TagService::class],
|
2016-07-19 10:17:37 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|