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