vendor/novaway/sync-bundle/src/Resources/config/services.php line 12

Open in your IDE?
  1. <?php
  2. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  3. use Novaway\SyncBundle\Common\Log\SyncLogger;
  4. use Novaway\SyncBundle\Target\Date\DateCacheHandler;
  5. use Symfony\Component\Cache\Adapter\PdoAdapter;
  6. if (!\function_exists('backportableServiceFunction')) {
  7.     function backportableServiceFunction(string $serviceName)
  8.     {
  9.         return \function_exists('service') ? service($serviceName) : ref($serviceName);
  10.     }
  11. }
  12. return function (ContainerConfigurator $configurator) {
  13.     $services $configurator->services()
  14.         ->defaults()
  15.         ->autowire()
  16.         ->autoconfigure()
  17.         ->bind('$tokenApi''%sync_bundle.auth_token%')
  18.     ;
  19.     $configurator->parameters()->set('sync_bundle.auth_token''todo');
  20.     $services->load('Novaway\\SyncBundle\\Target\\''../../../src/Target/*');
  21.     $services->load('Novaway\\SyncBundle\\Source\\''../../../src/Source/*');
  22.     $services->load('Novaway\\SyncBundle\\Common\\''../../../src/Common/*');
  23.     $services->load('Novaway\\SyncBundle\\Source\\Controller\\''../../../src/Source/Controller/ApiController.php')
  24.         ->tag('controller.service_arguments');
  25.     $services->load('Novaway\\SyncBundle\\Source\\Security\\''../../../src/Source/Security/TokenAuthenticator.php');
  26.     $services->set(SyncLogger::class)
  27.         ->tag('monolog.logger', ['channel' => 'sync'])
  28.     ;
  29.     $services->set('db_cache')
  30.         ->class(PdoAdapter::class)
  31.         ->args([
  32.             '$connOrDsn' =>  backportableServiceFunction('doctrine.dbal.default_connection')
  33.         ])
  34.     ;
  35.     $services->set(DateCacheHandler::class)
  36.         ->args([
  37.             '$cache' => backportableServiceFunction('db_cache')
  38.         ]);
  39.     $services->set(\Novaway\SyncBundle\Target\Count\CountCacheHandler::class)
  40.         ->args([
  41.             '$cache' => backportableServiceFunction('db_cache')
  42.         ]);
  43. };