shlink/module/Common/config/dependencies.config.php

62 lines
2.2 KiB
PHP
Raw Normal View History

2016-07-19 18:38:41 +03:00
<?php
2016-07-19 18:38:41 +03:00
use Doctrine\Common\Cache\Cache;
use Doctrine\ORM\EntityManager;
2016-08-08 13:07:04 +03:00
use Monolog\Logger;
use Psr\Log\LoggerInterface;
use Shlinkio\Shlink\Common\Factory;
use Shlinkio\Shlink\Common\Image;
use Shlinkio\Shlink\Common\Image\ImageBuilder;
use Shlinkio\Shlink\Common\Middleware\LocaleMiddleware;
use Shlinkio\Shlink\Common\Service;
use Shlinkio\Shlink\Common\Template\Extension\TranslatorExtension;
use Symfony\Component\Filesystem\Filesystem;
use Zend\I18n\Translator\Translator;
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
2016-07-19 18:38:41 +03:00
use Zend\ServiceManager\Factory\InvokableFactory;
return [
'dependencies' => [
2016-07-19 18:38:41 +03:00
'factories' => [
EntityManager::class => Factory\EntityManagerFactory::class,
2016-07-19 18:38:41 +03:00
GuzzleHttp\Client::class => InvokableFactory::class,
Cache::class => Factory\CacheFactory::class,
'Logger_Shlink' => Factory\LoggerFactory::class,
Filesystem::class => InvokableFactory::class,
Translator::class => Factory\TranslatorFactory::class,
TranslatorExtension::class => ConfigAbstractFactory::class,
LocaleMiddleware::class => ConfigAbstractFactory::class,
Image\ImageBuilder::class => Image\ImageBuilderFactory::class,
Service\IpLocationResolver::class => ConfigAbstractFactory::class,
Service\PreviewGenerator::class => ConfigAbstractFactory::class,
2016-07-19 18:38:41 +03:00
],
'aliases' => [
'em' => EntityManager::class,
'httpClient' => GuzzleHttp\Client::class,
'translator' => Translator::class,
'logger' => LoggerInterface::class,
Logger::class => 'Logger_Shlink',
LoggerInterface::class => 'Logger_Shlink',
2016-07-19 18:38:41 +03:00
],
'abstract_factories' => [
Factory\DottedAccessConfigAbstractFactory::class,
],
2016-07-19 18:38:41 +03:00
],
ConfigAbstractFactory::class => [
TranslatorExtension::class => ['translator'],
LocaleMiddleware::class => ['translator'],
Service\IpLocationResolver::class => ['httpClient'],
Service\PreviewGenerator::class => [
ImageBuilder::class,
Filesystem::class,
'config.preview_generation.files_location',
],
],
2016-07-19 18:38:41 +03:00
];