services:

# Storages
    storage.attachment:
        class: phpbb\storage\storage
        arguments:
            - '@storage.adapter.factory'
            - '@storage.file_tracker'
            - 'attachment'
        tags:
            - { name: storage }

    storage.avatar:
        class: phpbb\storage\storage
        arguments:
            - '@storage.adapter.factory'
            - '@storage.file_tracker'
            - 'avatar'
        tags:
            - { name: storage }

    storage.backup:
        class: phpbb\storage\storage
        arguments:
            - '@storage.adapter.factory'
            - '@storage.file_tracker'
            - 'backup'
        tags:
            - { name: storage }

# Factory
    storage.adapter.factory:
        class: phpbb\storage\adapter_factory
        arguments:
            - '@config'
            - '@storage.adapter_collection'
            - '@storage.provider_collection'

# Collections
    storage.storage_collection:
        class: phpbb\di\service_collection
        arguments:
            - '@service_container'
        tags:
            - { name: service_collection, tag: storage }

    storage.adapter_collection:
        class: phpbb\di\service_collection
        arguments:
            - '@service_container'
        tags:
            - { name: service_collection, tag: storage.adapter, class_name_aware: true }

    storage.provider_collection:
        class: phpbb\di\service_collection
        arguments:
            - '@service_container'
        tags:
            - { name: service_collection, tag: storage.provider, class_name_aware: true }

# Adapters
    storage.adapter.local:
        class: phpbb\storage\adapter\local
        shared: false
        arguments:
            - '@filesystem'
            - '%core.root_path%'
        tags:
            - { name: storage.adapter }

# Providers
    storage.provider.local:
        class: phpbb\storage\provider\local
        arguments:
            - '@language'
        tags:
            - { name: storage.provider }

# Controllers
    storage.controller.avatar:
        class: phpbb\storage\controller\avatar
        arguments:
            - '@cache'
            - '@config'
            - '@dbal.conn'
            - '@mimetype.extension_guesser'
            - '@storage.avatar'
            - '@symfony_request'

    storage.controller.attachment:
        class: phpbb\storage\controller\attachment
        arguments:
            - '@auth'
            - '@cache'
            - '@config'
            - '@content.visibility'
            - '@dbal.conn'
            - '@event_dispatcher'
            - '@mimetype.extension_guesser'
            - '@language'
            - '@request'
            - '@storage.attachment'
            - '@symfony_request'
            - '@user'

# Helpers
    storage.state_helper:
        class: phpbb\storage\state_helper
        arguments:
            - '@config'
            - '@config_text'
            - '@storage.provider_collection'

    storage.helper:
        class: phpbb\storage\helper
        arguments:
            - '@config'
            - '@storage.adapter.factory'
            - '@storage.state_helper'
            - '@storage.provider_collection'
            - '@storage.adapter_collection'

    storage.file_tracker:
        class: phpbb\storage\file_tracker
        arguments:
            - '@cache.driver'
            - '@dbal.conn'
            - '%tables.storage%'

