2023-03-01 12:38:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace DanielSiepmann\Configuration;
|
|
|
|
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2023-03-06 11:47:12 +01:00
|
|
|
use WerkraumMedia\ABTest\Events\SwitchedToVariant;
|
|
|
|
use WerkraumMedia\ABTest\Hook\TypoScriptFrontendController;
|
2023-03-06 14:39:21 +01:00
|
|
|
use WerkraumMedia\ABTest\MatomoTracker;
|
2023-03-06 11:47:12 +01:00
|
|
|
use WerkraumMedia\ABTest\Middleware\SetCookie;
|
2023-03-01 12:38:59 +01:00
|
|
|
use WerkraumMedia\ABTest\TCA\VariantFilter;
|
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator) {
|
|
|
|
$services = $containerConfigurator
|
|
|
|
->services()
|
|
|
|
->defaults()
|
|
|
|
->autowire()
|
|
|
|
->autoconfigure()
|
|
|
|
;
|
|
|
|
|
|
|
|
$services->load('WerkraumMedia\\ABTest\\', '../Classes/');
|
|
|
|
|
2023-03-06 11:47:12 +01:00
|
|
|
$services->set(TypoScriptFrontendController::class)->public();
|
2023-03-01 12:38:59 +01:00
|
|
|
$services->set(VariantFilter::class)->public();
|
2023-03-06 11:47:12 +01:00
|
|
|
$services->set(SetCookie::class)->tag('event.listener', [
|
|
|
|
'method' => 'handleVariant',
|
|
|
|
'event' => SwitchedToVariant::class,
|
|
|
|
]);
|
2023-03-06 14:39:21 +01:00
|
|
|
$services->set(MatomoTracker::class)->tag('event.listener', [
|
|
|
|
'method' => 'handleVariant',
|
|
|
|
'event' => SwitchedToVariant::class,
|
|
|
|
]);
|
2023-03-01 12:38:59 +01:00
|
|
|
};
|