<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Novaway\SyncBundle\Common\Log\SyncLogger;
use Novaway\SyncBundle\Target\Date\DateCacheHandler;
use Symfony\Component\Cache\Adapter\PdoAdapter;
if (!\function_exists('backportableServiceFunction')) {
function backportableServiceFunction(string $serviceName)
{
return \function_exists('service') ? service($serviceName) : ref($serviceName);
}
}
return function (ContainerConfigurator $configurator) {
$services = $configurator->services()
->defaults()
->autowire()
->autoconfigure()
->bind('$tokenApi', '%sync_bundle.auth_token%')
;
$configurator->parameters()->set('sync_bundle.auth_token', 'todo');
$services->load('Novaway\\SyncBundle\\Target\\', '../../../src/Target/*');
$services->load('Novaway\\SyncBundle\\Source\\', '../../../src/Source/*');
$services->load('Novaway\\SyncBundle\\Common\\', '../../../src/Common/*');
$services->load('Novaway\\SyncBundle\\Source\\Controller\\', '../../../src/Source/Controller/ApiController.php')
->tag('controller.service_arguments');
$services->load('Novaway\\SyncBundle\\Source\\Security\\', '../../../src/Source/Security/TokenAuthenticator.php');
$services->set(SyncLogger::class)
->tag('monolog.logger', ['channel' => 'sync'])
;
$services->set('db_cache')
->class(PdoAdapter::class)
->args([
'$connOrDsn' => backportableServiceFunction('doctrine.dbal.default_connection')
])
;
$services->set(DateCacheHandler::class)
->args([
'$cache' => backportableServiceFunction('db_cache')
]);
$services->set(\Novaway\SyncBundle\Target\Count\CountCacheHandler::class)
->args([
'$cache' => backportableServiceFunction('db_cache')
]);
};