Created Common module

This commit is contained in:
Alejandro Celaya
2016-07-19 17:38:41 +02:00
parent 8fc88171ee
commit ba06ad44bd
17 changed files with 57 additions and 26 deletions

View File

@@ -1,11 +1,7 @@
<?php
use Acelaya\UrlShortener\Factory\CacheFactory;
use Acelaya\UrlShortener\Factory\EntityManagerFactory;
use Acelaya\UrlShortener\Middleware;
use Acelaya\UrlShortener\Service;
use Acelaya\ZsmAnnotatedServices\Factory\V3\AnnotatedFactory;
use Doctrine\Common\Cache\Cache;
use Doctrine\ORM\EntityManager;
use Zend\Expressive;
use Zend\Expressive\Container;
use Zend\Expressive\Helper;
@@ -32,21 +28,15 @@ return [
Template\TemplateRendererInterface::class => Twig\TwigRendererFactory::class,
// Services
EntityManager::class => EntityManagerFactory::class,
GuzzleHttp\Client::class => InvokableFactory::class,
Service\UrlShortener::class => AnnotatedFactory::class,
Service\VisitsTracker::class => AnnotatedFactory::class,
Service\ShortUrlService::class => AnnotatedFactory::class,
Cache::class => CacheFactory::class,
// Middleware
Middleware\Routable\RedirectMiddleware::class => AnnotatedFactory::class,
],
'aliases' => [
'em' => EntityManager::class,
'httpClient' => GuzzleHttp\Client::class,
Router\RouterInterface::class => Router\FastRouteRouter::class,
AnnotatedFactory::CACHE_SERVICE => Cache::class,
],
],

View File

@@ -1,5 +1,6 @@
<?php
use Shlinkio\Shlink\CLI;
use Shlinkio\Shlink\Common;
use Shlinkio\Shlink\Rest;
use Zend\Expressive\ConfigManager\ConfigManager;
use Zend\Expressive\ConfigManager\ZendConfigProvider;
@@ -16,6 +17,7 @@ use Zend\Expressive\ConfigManager\ZendConfigProvider;
return call_user_func(function () {
$configManager = new ConfigManager([
new ZendConfigProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
Common\ConfigProvider::class,
CLI\ConfigProvider::class,
Rest\ConfigProvider::class,
], 'data/cache/app_config.php');