parameters:
    oro_distribution.composer_json: '%kernel.project_dir%/composer.json'

    # Makes the service container compile into a single file instead of multiple small files. Improves memory usage.
    container.dumper.inline_factories: true

services:
    oro_distribution.routing_loader:
        class: Oro\Bundle\DistributionBundle\Routing\OroAutoLoader
        arguments:
            - '@kernel'
            - '@oro_distribution.routing_options_resolver'
        calls:
            - [setResolver, ['@routing.resolver']]
            - [setEventDispatcher, ['@event_dispatcher']]
            - [setCache, ['@oro_distribution.routing_loader.cache']]
        tags:
            - { name: routing.loader }

    oro_distribution.expose_routing_loader:
        class: Oro\Bundle\DistributionBundle\Routing\OroExposeLoader
        arguments:
            - '@kernel'
            - '@oro_distribution.routing_options_resolver'
        calls:
            - [setResolver, ['@routing.resolver']]
            - [setEventDispatcher, ['@event_dispatcher']]
            - [setCache, ['@oro_distribution.routing_loader.cache']]
        tags:
            - { name: routing.loader, priority: 255 }

    oro_distribution.routing_loader.cache:
        class: Oro\Bundle\DistributionBundle\Routing\SharedData
        public: false

    oro_distribution.routing_options_resolver:
        class: Oro\Component\Routing\Resolver\ChainRouteOptionsResolver
        public: false
        arguments:
            - !tagged_iterator routing.options_resolver

    oro_distribution.composer.io:
        class: Composer\IO\BufferIO
        public: false
        lazy: true

    oro_distribution.composer:
        class: Composer\Composer
        factory: ['Composer\Factory', create]
        arguments: ['@oro_distribution.composer.io', '%oro_distribution.composer_json%']
        lazy: true

    oro_distribution.composer.installation_manager:
        class: Composer\Installer\InstallationManager
        public: true
        factory: ['@oro_distribution.composer', getInstallationManager]
        lazy: true

    oro_distribution.composer.json_file:
        class: Composer\Json\JsonFile
        public: true
        arguments:
          - '%oro_distribution.composer_json%'

    oro_distribution.handler.application_status:
        public: true
        class: Oro\Bundle\DistributionBundle\Handler\ApplicationState
        arguments:
            - '@doctrine.dbal.config_connection'

    Oro\Bundle\DistributionBundle\Handler\ApplicationState:
        public: true
        alias: oro_distribution.handler.application_status

    oro_shipping.cache_warmer.set_is_installed:
        class: 'Oro\Bundle\DistributionBundle\CacheWarmer\SetIsInstalledCacheWarmer'
        arguments:
            - '@oro_distribution.handler.application_status'
        tags:
            - { name: oro_entity_extend.warmer, priority: 300 }
