2016-07-19 18:38:41 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
2017-07-22 14:41:41 +03:00
|
|
|
|
2018-10-18 20:53:50 +03:00
|
|
|
namespace Shlinkio\Shlink\Common;
|
|
|
|
|
2016-07-19 18:38:41 +03:00
|
|
|
use Doctrine\Common\Cache\Cache;
|
|
|
|
use Doctrine\ORM\EntityManager;
|
2018-11-11 14:40:40 +03:00
|
|
|
use GeoIp2\Database\Reader;
|
2018-10-18 20:53:50 +03:00
|
|
|
use GuzzleHttp\Client as GuzzleClient;
|
2016-08-08 13:07:04 +03:00
|
|
|
use Monolog\Logger;
|
2016-08-08 12:56:19 +03:00
|
|
|
use Psr\Log\LoggerInterface;
|
2018-10-18 20:53:50 +03:00
|
|
|
use RKA\Middleware\IpAddress;
|
2016-08-18 14:20:57 +03:00
|
|
|
use Symfony\Component\Filesystem\Filesystem;
|
2016-07-21 16:08:46 +03:00
|
|
|
use Zend\I18n\Translator\Translator;
|
2017-07-22 14:41:41 +03:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2016-07-19 18:38:41 +03:00
|
|
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 17:30:05 +03:00
|
|
|
'dependencies' => [
|
2016-07-19 18:38:41 +03:00
|
|
|
'factories' => [
|
2016-08-18 14:20:57 +03:00
|
|
|
EntityManager::class => Factory\EntityManagerFactory::class,
|
2018-10-18 20:53:50 +03:00
|
|
|
GuzzleClient::class => InvokableFactory::class,
|
2016-08-18 14:20:57 +03:00
|
|
|
Cache::class => Factory\CacheFactory::class,
|
|
|
|
'Logger_Shlink' => Factory\LoggerFactory::class,
|
2017-07-22 14:41:41 +03:00
|
|
|
Filesystem::class => InvokableFactory::class,
|
2018-11-11 14:40:40 +03:00
|
|
|
Reader::class => ConfigAbstractFactory::class,
|
2016-08-08 12:56:19 +03:00
|
|
|
|
2016-08-18 14:20:57 +03:00
|
|
|
Translator::class => Factory\TranslatorFactory::class,
|
2018-10-18 20:53:50 +03:00
|
|
|
Template\Extension\TranslatorExtension::class => ConfigAbstractFactory::class,
|
|
|
|
|
|
|
|
Middleware\LocaleMiddleware::class => ConfigAbstractFactory::class,
|
|
|
|
IpAddress::class => Middleware\IpAddressMiddlewareFactory::class,
|
2016-07-30 14:51:52 +03:00
|
|
|
|
2016-08-18 13:21:26 +03:00
|
|
|
Image\ImageBuilder::class => Image\ImageBuilderFactory::class,
|
|
|
|
|
2018-11-11 14:44:57 +03:00
|
|
|
IpGeolocation\IpApiLocationResolver::class => ConfigAbstractFactory::class,
|
|
|
|
IpGeolocation\GeoLite2LocationResolver::class => ConfigAbstractFactory::class,
|
2018-11-11 15:18:21 +03:00
|
|
|
IpGeolocation\ChainIpLocationResolver::class => ConfigAbstractFactory::class,
|
|
|
|
|
2017-07-22 14:41:41 +03:00
|
|
|
Service\PreviewGenerator::class => ConfigAbstractFactory::class,
|
2016-07-19 18:38:41 +03:00
|
|
|
],
|
|
|
|
'aliases' => [
|
|
|
|
'em' => EntityManager::class,
|
2018-10-18 20:53:50 +03:00
|
|
|
'httpClient' => GuzzleClient::class,
|
2016-07-21 16:08:46 +03:00
|
|
|
'translator' => Translator::class,
|
2016-08-08 12:56:19 +03:00
|
|
|
'logger' => LoggerInterface::class,
|
2016-08-12 19:01:09 +03:00
|
|
|
Logger::class => 'Logger_Shlink',
|
|
|
|
LoggerInterface::class => 'Logger_Shlink',
|
2018-11-11 14:44:57 +03:00
|
|
|
IpGeolocation\IpLocationResolverInterface::class => IpGeolocation\GeoLite2LocationResolver::class,
|
2016-07-19 18:38:41 +03:00
|
|
|
],
|
2017-07-22 14:33:32 +03:00
|
|
|
'abstract_factories' => [
|
|
|
|
Factory\DottedAccessConfigAbstractFactory::class,
|
|
|
|
],
|
2016-07-19 18:38:41 +03:00
|
|
|
],
|
|
|
|
|
2017-07-22 14:41:41 +03:00
|
|
|
ConfigAbstractFactory::class => [
|
2018-11-11 14:40:40 +03:00
|
|
|
Reader::class => ['config.geolite2.db_location'],
|
|
|
|
|
2018-10-18 20:53:50 +03:00
|
|
|
Template\Extension\TranslatorExtension::class => ['translator'],
|
|
|
|
Middleware\LocaleMiddleware::class => ['translator'],
|
2018-11-11 15:18:21 +03:00
|
|
|
|
2018-11-11 14:44:57 +03:00
|
|
|
IpGeolocation\IpApiLocationResolver::class => ['httpClient'],
|
|
|
|
IpGeolocation\GeoLite2LocationResolver::class => [Reader::class],
|
2018-11-11 15:18:21 +03:00
|
|
|
IpGeolocation\ChainIpLocationResolver::class => [
|
|
|
|
IpGeolocation\GeoLite2LocationResolver::class,
|
|
|
|
IpGeolocation\IpApiLocationResolver::class,
|
|
|
|
],
|
|
|
|
|
2017-07-22 14:41:41 +03:00
|
|
|
Service\PreviewGenerator::class => [
|
2018-10-18 20:53:50 +03:00
|
|
|
Image\ImageBuilder::class,
|
2017-07-22 14:41:41 +03:00
|
|
|
Filesystem::class,
|
|
|
|
'config.preview_generation.files_location',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2016-07-19 18:38:41 +03:00
|
|
|
];
|