services:
  Telnowedge\BaseBundle\Manager\FreePbxManagerFactory: ~

  Telnowedge\BaseBundle\Manager\XSSOTokenManager:
    calls:
      - method: setLogger
        arguments:
          $logger: '@monolog.logger.security'

  Telnowedge\BaseBundle\Manager\VersionManager:
    calls:
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'

  freepbx_manager:
    class: \FreePBX
    factory: 'Telnowedge\BaseBundle\Manager\FreePbxManagerFactory:getFreePbxManager'

  freepbx_container:
    class: Symfony\Component\DependencyInjection\ContainerInterface
    factory: 'Telnowedge\BaseBundle\Manager\FreePbxManagerFactory:getFreePbxContainer'

  telnowedge_base_logger:
    class: Symfony\Bridge\Monolog\Logger
    factory: 'Telnowedge\BaseBundle\Logger\Logger::getLoggerFactory'
    arguments:
      $logger: '@logger'
    tags:
      - {name: monolog.logger, channel: telnowedge_base}

  Telnowedge\BaseBundle\Util\ExtensionCollectionFilter:
    arguments:
      $tokenStorage: '@security.token_storage'

  Telnowedge\BaseBundle\Form\RepositoryType:
    calls:
      - method: setContainer
        arguments:
          - '@service_container'
      - method: setFreePbxContainer
        arguments:
          - '@freepbx_container'
    tags:
      - "form.type"

  Telnowedge\BaseBundle\Form\DestinationType:
    calls:
      - method: setContainer
        arguments:
          - '@freepbx_container'
    tags:
      - "form.type"

  Symfony\Component\Cache\Adapter\FilesystemAdapter:
    arguments:
      - 'telnowedge'
      - 0
      - '%kernel.cache_dir%'

  Telnowedge\BaseBundle\Manager\AbstractCacheManager:
    abstract: true

  Telnowedge\BaseBundle\Manager\FilesystemCacheManager:
    parent: Telnowedge\BaseBundle\Manager\AbstractCacheManager
    calls:
      - method: setAdapter
        arguments:
          - '@Symfony\Component\Cache\Adapter\FilesystemAdapter'
