2016-07-19 18:17:37 +03:00
|
|
|
<?php
|
2019-10-05 18:26:10 +03:00
|
|
|
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
2017-07-22 14:33:32 +03:00
|
|
|
|
2018-09-29 10:52:32 +03:00
|
|
|
namespace Shlinkio\Shlink\CLI;
|
|
|
|
|
2019-08-05 11:08:59 +03:00
|
|
|
use Doctrine\DBAL\Connection;
|
2019-04-14 12:19:21 +03:00
|
|
|
use GeoIp2\Database\Reader;
|
2020-01-01 23:11:53 +03:00
|
|
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
use Laminas\ServiceManager\Factory\InvokableFactory;
|
2019-04-14 12:19:21 +03:00
|
|
|
use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
|
2019-08-05 19:48:33 +03:00
|
|
|
use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory;
|
2017-07-22 14:33:32 +03:00
|
|
|
use Shlinkio\Shlink\Core\Service;
|
2020-05-08 11:29:24 +03:00
|
|
|
use Shlinkio\Shlink\Core\Tag\TagService;
|
2020-03-27 00:17:13 +03:00
|
|
|
use Shlinkio\Shlink\Core\Visit;
|
2019-08-11 21:34:55 +03:00
|
|
|
use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory;
|
2019-08-10 14:42:37 +03:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater;
|
2019-08-10 14:56:06 +03:00
|
|
|
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
2017-07-22 14:33:32 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Service\ApiKeyService;
|
2019-08-04 12:30:35 +03:00
|
|
|
use Symfony\Component\Console as SymfonyCli;
|
2019-11-30 19:21:36 +03:00
|
|
|
use Symfony\Component\Lock\LockFactory;
|
2019-08-04 12:30:35 +03:00
|
|
|
use Symfony\Component\Process\PhpExecutableFinder;
|
2016-07-19 18:17:37 +03:00
|
|
|
|
2020-03-22 19:42:56 +03:00
|
|
|
use const Shlinkio\Shlink\Core\LOCAL_LOCK_FACTORY;
|
|
|
|
|
2016-07-19 18:17:37 +03:00
|
|
|
return [
|
|
|
|
|
2016-07-31 17:30:05 +03:00
|
|
|
'dependencies' => [
|
2016-07-19 18:17:37 +03:00
|
|
|
'factories' => [
|
2019-08-04 12:30:35 +03:00
|
|
|
SymfonyCli\Application::class => Factory\ApplicationFactory::class,
|
2019-08-11 21:34:55 +03:00
|
|
|
SymfonyCli\Helper\ProcessHelper::class => ProcessHelperFactory::class,
|
2019-08-04 12:30:35 +03:00
|
|
|
PhpExecutableFinder::class => InvokableFactory::class,
|
2016-07-19 18:17:37 +03:00
|
|
|
|
2019-04-14 12:19:21 +03:00
|
|
|
GeolocationDbUpdater::class => ConfigAbstractFactory::class,
|
|
|
|
|
2018-09-16 19:36:02 +03: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\DeleteShortUrlCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2019-04-14 10:10:00 +03:00
|
|
|
Command\Visit\LocateVisitsCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2017-07-22 14:33:32 +03:00
|
|
|
Command\Api\GenerateKeyCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Api\DisableKeyCommand::class => ConfigAbstractFactory::class,
|
|
|
|
Command\Api\ListKeysCommand::class => ConfigAbstractFactory::class,
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2017-07-22 14:33:32 +03: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,
|
2019-08-04 12:30:35 +03:00
|
|
|
|
|
|
|
Command\Db\CreateDatabaseCommand::class => ConfigAbstractFactory::class,
|
2019-08-06 21:48:48 +03:00
|
|
|
Command\Db\MigrateDatabaseCommand::class => ConfigAbstractFactory::class,
|
2017-07-22 14:33:32 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2020-03-22 19:42:56 +03:00
|
|
|
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, LOCAL_LOCK_FACTORY],
|
2019-04-14 12:19:21 +03:00
|
|
|
|
2020-02-18 22:34:48 +03:00
|
|
|
Command\ShortUrl\GenerateShortUrlCommand::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'config.url_shortener.default_short_codes_length',
|
|
|
|
],
|
2020-01-26 21:21:51 +03:00
|
|
|
Command\ShortUrl\ResolveUrlCommand::class => [Service\ShortUrl\ShortUrlResolver::class],
|
2018-11-18 18:02:52 +03:00
|
|
|
Command\ShortUrl\ListShortUrlsCommand::class => [Service\ShortUrlService::class, 'config.url_shortener.domain'],
|
|
|
|
Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class],
|
|
|
|
Command\ShortUrl\DeleteShortUrlCommand::class => [Service\ShortUrl\DeleteShortUrlService::class],
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2019-04-14 10:10:00 +03:00
|
|
|
Command\Visit\LocateVisitsCommand::class => [
|
2020-03-27 00:17:13 +03:00
|
|
|
Visit\VisitLocator::class,
|
2018-11-11 14:40:40 +03:00
|
|
|
IpLocationResolverInterface::class,
|
2019-11-30 19:21:36 +03:00
|
|
|
LockFactory::class,
|
2019-04-14 18:59:22 +03:00
|
|
|
GeolocationDbUpdater::class,
|
2016-07-19 18:17:37 +03:00
|
|
|
],
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2018-11-18 18:02:52 +03:00
|
|
|
Command\Api\GenerateKeyCommand::class => [ApiKeyService::class],
|
|
|
|
Command\Api\DisableKeyCommand::class => [ApiKeyService::class],
|
|
|
|
Command\Api\ListKeysCommand::class => [ApiKeyService::class],
|
2018-09-15 18:57:12 +03:00
|
|
|
|
2020-05-08 11:29:24 +03:00
|
|
|
Command\Tag\ListTagsCommand::class => [TagService::class],
|
|
|
|
Command\Tag\CreateTagCommand::class => [TagService::class],
|
|
|
|
Command\Tag\RenameTagCommand::class => [TagService::class],
|
|
|
|
Command\Tag\DeleteTagsCommand::class => [TagService::class],
|
2019-08-04 12:30:35 +03:00
|
|
|
|
|
|
|
Command\Db\CreateDatabaseCommand::class => [
|
2019-11-30 19:21:36 +03:00
|
|
|
LockFactory::class,
|
2019-08-04 12:30:35 +03:00
|
|
|
SymfonyCli\Helper\ProcessHelper::class,
|
|
|
|
PhpExecutableFinder::class,
|
2019-08-05 11:08:59 +03:00
|
|
|
Connection::class,
|
2019-08-05 19:48:33 +03:00
|
|
|
NoDbNameConnectionFactory::SERVICE_NAME,
|
2019-08-04 12:30:35 +03:00
|
|
|
],
|
2019-08-06 21:48:48 +03:00
|
|
|
Command\Db\MigrateDatabaseCommand::class => [
|
2019-11-30 19:21:36 +03:00
|
|
|
LockFactory::class,
|
2019-08-06 21:48:48 +03:00
|
|
|
SymfonyCli\Helper\ProcessHelper::class,
|
|
|
|
PhpExecutableFinder::class,
|
|
|
|
],
|
2016-07-19 18:17:37 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|