services:
    _defaults:
        autowire: false
        autoconfigure: false
        public: true

    Claroline\CoreBundle\Library\Configuration\PlatformConfigurationHandler:
        arguments:
            - '%claroline.param.platform_options%'
            - '@request_stack'

    Claroline\CoreBundle\Library\Installation\Plugin\Recorder:
        arguments:
            - '@Claroline\CoreBundle\Library\Installation\Plugin\DatabaseWriter'
            - '@claroline.plugin.validator'

    Claroline\CoreBundle\Library\Installation\Plugin\Loader: ~

    Claroline\CoreBundle\Library\Installation\Plugin\Installer:
        arguments:
            - '@claroline.plugin.validator'
            - '@Claroline\CoreBundle\Library\Installation\Plugin\Recorder'
            - '@Claroline\InstallationBundle\Manager\InstallationManager'
            - '@Claroline\AppBundle\Persistence\ObjectManager'
            - '@Claroline\CoreBundle\Manager\PluginManager'
            - '@Claroline\CoreBundle\Manager\VersionManager'
        calls:
            - setLogger: [ '@logger' ]

    Claroline\CoreBundle\Library\Installation\Plugin\DatabaseWriter:
        arguments:
            - '@Claroline\AppBundle\Persistence\ObjectManager'
            - '@Claroline\CoreBundle\Manager\Resource\MaskManager'
            - '@filesystem'
            - '@Claroline\CoreBundle\Manager\Tool\ToolManager'
            - '@Claroline\CoreBundle\Manager\Tool\ToolMaskDecoderManager'
            - '@Claroline\ThemeBundle\Manager\IconSetBuilderManager'
        calls:
            - setLogger: [ '@logger' ]

    Claroline\CoreBundle\Library\Installation\Plugin\ConfigurationChecker:
        arguments:
            - '@claroline.symfony_yaml'
            - '@doctrine.orm.entity_manager'

    Claroline\CoreBundle\Library\Installation\PlatformInstaller:
        arguments:
            - '@kernel'
            - '@Claroline\CoreBundle\Manager\PluginManager'
            - '@Claroline\CoreBundle\Library\Installation\Plugin\Installer'
            - '@Claroline\AppBundle\Persistence\ObjectManager'
            - '@Claroline\InstallationBundle\Manager\InstallationManager'
            - '@service_container'
        calls:
            - setLogger: [ '@logger' ]

    Claroline\CoreBundle\Library\Mailing\TransportFactory:
        arguments:
            - '@Claroline\CoreBundle\Library\Configuration\PlatformConfigurationHandler'
            - '@event_dispatcher'
            - '@logger'

    Claroline\CoreBundle\Library\Mailing\Mailer:
        arguments:
            - '@Claroline\CoreBundle\Library\Configuration\PlatformConfigurationHandler'
            - '%kernel.logs_dir%'

    Claroline\CoreBundle\Library\Mailing\Client\SymfonyMailer:
        tags: ['claroline.mailing']
        arguments:
            - '@mailer'
            - '@logger'

    Claroline\CoreBundle\Library\Mailing\Client\PostalMailer:
        tags: ['claroline.mailing']
        arguments:
            - '@Claroline\CoreBundle\Library\Configuration\PlatformConfigurationHandler'

    Claroline\CoreBundle\Library\RoutingHelper:
        arguments:
            - '@router'

    Claroline\CoreBundle\Library\ICS\ICSGenerator:
        arguments:
            - '%claroline.param.files_directory%'
            - '@filesystem'

    # GeoIp
    Claroline\CoreBundle\Library\GeoIp\Database\MaxMindGeoIpDatabaseDownloader:
        arguments:
            - '@Claroline\CoreBundle\Library\Configuration\PlatformConfigurationHandler'
            - '%claroline.tmp_dir%'
            - '@logger'
            - '@?http_client'
            - '@filesystem'

    Claroline\CoreBundle\Library\GeoIp\MaxMindGeoIpInfoProvider:
        arguments: ['@GeoIp2\Database\Reader']

    Claroline\CoreBundle\Library\GeoIp\GeoIpInfoProviderInterface:
        alias: 'Claroline\CoreBundle\Library\GeoIp\MaxMindGeoIpInfoProvider'

    GeoIp2\Database\Reader:
        arguments: [ '%claroline.param.geoip_db_path%' ]
