Moved all logic to redirect to specific URLs when a 404 is found to the NotFoundHandler

This commit is contained in:
Alejandro Celaya
2019-11-02 18:33:26 +01:00
parent 24c3a3e84c
commit eeb5306883
5 changed files with 119 additions and 55 deletions

View File

@@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Core;
use Doctrine\Common\Cache\Cache;
use Psr\EventDispatcher\EventDispatcherInterface;
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
use Shlinkio\Shlink\Core\Response\NotFoundHandler;
use Shlinkio\Shlink\PreviewGenerator\Service\PreviewGenerator;
use Zend\Expressive\Router\RouterInterface;
@@ -40,7 +41,11 @@ return [
],
ConfigAbstractFactory::class => [
NotFoundHandler::class => [TemplateRendererInterface::class],
NotFoundHandler::class => [
TemplateRendererInterface::class,
NotFoundRedirectOptions::class,
'config.router.base_path',
],
Options\AppOptions::class => ['config.app_options'],
Options\DeleteShortUrlsOptions::class => ['config.delete_short_urls'],
@@ -58,7 +63,6 @@ return [
Service\UrlShortener::class,
Service\VisitsTracker::class,
Options\AppOptions::class,
Options\NotFoundRedirectOptions::class,
'Logger_Shlink',
],
Action\PixelAction::class => [