services:
    _defaults:
        autoconfigure: true

    _instanceof:
        Symfony\Component\DependencyInjection\ContainerAwareInterface:
            calls:
                - [setContainer, ['@service_container']]

    contao_installation.command.lock:
        class: Contao\InstallationBundle\Command\LockCommand
        arguments:
            - '%kernel.project_dir%/var/install_lock'

    contao_installation.command.unlock:
        class: Contao\InstallationBundle\Command\UnlockCommand
        arguments:
            - '%kernel.project_dir%/var/install_lock'

    contao_installation.database.installer:
        class: Contao\InstallationBundle\Database\Installer
        public: true
        arguments:
            - '@database_connection'
            - '@contao.doctrine.schema_provider'

    contao_installation.install_tool:
        class: Contao\InstallationBundle\InstallTool
        public: true
        arguments:
            - '@database_connection'
            - '%kernel.project_dir%'
            - '@logger'
            - '@contao.migration.collection'

    contao_installation.install_tool_user:
        class: Contao\InstallationBundle\InstallToolUser
        public: true
        arguments:
            - '@session'

    contao_installation.listener.initialize_application:
        class: Contao\InstallationBundle\EventListener\InitializeApplicationListener
        tags:
            - kernel.event_listener

    contao_installation.twig.ansi_extension:
        class: SensioLabs\AnsiConverter\Bridge\Twig\AnsiExtension

    # Backwards compatibility
    contao.install_tool:
        alias: contao_installation.install_tool
        public: true
        deprecated:
            package: contao/installation-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao_installation.install_tool" instead.

    contao.install_tool_user:
        alias: contao_installation.install_tool_user
        public: true
        deprecated:
            package: contao/installation-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao_installation.install_tool_user" instead.

    contao.installer:
        alias: contao_installation.database.installer
        public: true
        deprecated:
            package: contao/installation-bundle
            version: 4.13
            message: Using the "%alias_id%" service ID has been deprecated and will no longer work in Contao 5.0. Please use "contao_installation.database.installer" instead.
