imports:
    - { resource: tables.yml }
    - { resource: cron_tasks.yml }
    - { resource: notifications.yml }
    - { resource: migrator.yml }
    - { resource: avatars.yml }
    - { resource: feed.yml }
    - { resource: auth_providers.yml }
    - { resource: console.yml }
    - { resource: mimetype_guessers.yml }
    - { resource: passwords.yml }
    - { resource: profilefields.yml }

services:
    acl.permissions:
        class: phpbb\permissions
        arguments:
            - @dispatcher
            - @user

    auth:
        class: phpbb\auth\auth

    avatar.manager:
        class: phpbb\avatar\manager
        arguments:
            - @config
            - @avatar.driver_collection

    cache:
        class: phpbb\cache\service
        arguments:
             - @cache.driver
             - @config
             - @dbal.conn
             - %core.root_path%
             - %core.php_ext%

    cache.driver:
        class: %cache.driver.class%

    cache.driver.install:
        class: phpbb\cache\driver\file

    class_loader:
        class: phpbb\class_loader
        arguments:
            - phpbb\
            - %core.root_path%includes/
            - %core.php_ext%
        calls:
            - [register, []]
            - [set_cache, [@cache.driver]]

    class_loader.ext:
        class: phpbb\class_loader
        arguments:
            - \
            - %core.root_path%ext/
            - %core.php_ext%
        calls:
            - [register, []]
            - [set_cache, [@cache.driver]]

    config:
        class: phpbb\config\db
        arguments:
            - @dbal.conn
            - @cache.driver
            - %tables.config%

    config_text:
        class: phpbb\config\db_text
        arguments:
            - @dbal.conn
            - %tables.config_text%

    content.visibility:
        class: phpbb\content_visibility
        arguments:
            - @auth
            - @dbal.conn
            - @user
            - %core.root_path%
            - %core.php_ext%
            - %tables.forums%
            - %tables.posts%
            - %tables.topics%
            - %tables.users%

    controller.helper:
        class: phpbb\controller\helper
        arguments:
            - @template
            - @user
            - @config
            - @controller.provider
            - @ext.manager
            - %core.root_path%
            - %core.php_ext%

    controller.resolver:
        class: phpbb\controller\resolver
        arguments:
            - @user
            - @service_container
            - %core.root_path%
            - @template

    controller.provider:
        class: phpbb\controller\provider
        calls:
            - [find, [%core.root_path%]]

    cron.task_collection:
        class: phpbb\di\service_collection
        arguments:
            - @service_container
        tags:
            - { name: service_collection, tag: cron.task }

    cron.manager:
        class: phpbb\cron\manager
        arguments:
            - @cron.task_collection
            - %core.root_path%
            - %core.php_ext%

    cron.lock_db:
        class: phpbb\lock\db
        arguments:
            - cron_lock
            - @config
            - @dbal.conn

    dispatcher:
        class: phpbb\event\dispatcher
        arguments:
            - @service_container

    dbal.conn:
        class: %dbal.driver.class%
        calls:
            - [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]

    dbal.tools:
        class: phpbb\db\tools
        arguments:
            - @dbal.conn

    event.subscriber_loader:
        class: phpbb\event\extension_subscriber_loader
        arguments:
            - @dispatcher
            - @event.listener_collection
        calls:
            - [load, []]

    event.listener_collection:
        class: phpbb\di\service_collection
        arguments:
            - @service_container
        tags:
            - { name: service_collection, tag: event.listener }

    ext.manager:
        class: phpbb\extension\manager
        arguments:
            - @service_container
            - @dbal.conn
            - @config
            - @filesystem
            - @user
            - %tables.ext%
            - %core.root_path%
            - %core.php_ext%
            - @cache.driver

    filesystem:
        class: phpbb\filesystem

    groupposition.legend:
        class: phpbb\groupposition\legend
        arguments:
            - @dbal.conn
            - @user

    groupposition.teampage:
        class: phpbb\groupposition\teampage
        arguments:
            - @dbal.conn
            - @user
            - @cache.driver

    http_kernel:
        class: Symfony\Component\HttpKernel\HttpKernel
        arguments:
            - @dispatcher
            - @controller.resolver

    hook_finder:
        class: phpbb\hook\finder
        arguments:
            - %core.root_path%
            - %core.php_ext%
            - @cache.driver

    kernel_request_subscriber:
        class: phpbb\event\kernel_request_subscriber
        arguments:
            - @ext.manager
            - %core.root_path%
            - %core.php_ext%
        tags:
            - { name: kernel.event_subscriber }

    kernel_exception_subscriber:
        class: phpbb\event\kernel_exception_subscriber
        arguments:
            - @template
            - @user
        tags:
            - { name: kernel.event_subscriber }

    kernel_terminate_subscriber:
        class: phpbb\event\kernel_terminate_subscriber
        tags:
            - { name: kernel.event_subscriber }

    log:
        class: phpbb\log\log
        arguments:
            - @dbal.conn
            - @user
            - @auth
            - @dispatcher
            - %core.root_path%
            - %core.adm_relative_path%
            - %core.php_ext%
            - %tables.log%

    message.form.admin:
        class: phpbb\message\admin_form
        arguments:
            - @auth
            - @config
            - @config_text
            - @dbal.conn
            - @user
            - %core.root_path%
            - %core.php_ext%

    message.form.topic:
        class: phpbb\message\topic_form
        arguments:
            - @auth
            - @config
            - @config_text
            - @dbal.conn
            - @user
            - %core.root_path%
            - %core.php_ext%

    message.form.user:
        class: phpbb\message\user_form
        arguments:
            - @auth
            - @config
            - @dbal.conn
            - @user
            - %core.root_path%
            - %core.php_ext%

    notification_manager:
        class: phpbb\notification\manager
        arguments:
            - @notification.type_collection
            - @notification.method_collection
            - @service_container
            - @user_loader
            - @config
            - @dbal.conn
            - @cache
            - @user
            - %core.root_path%
            - %core.php_ext%
            - %tables.notification_types%
            - %tables.notifications%
            - %tables.user_notifications%

    pagination:
        class: phpbb\pagination
        arguments:
            - @template
            - @user
            - @controller.helper

    path_helper:
        class: phpbb\path_helper
        arguments:
            - @symfony_request
            - @filesystem
            - %core.root_path%
            - %core.php_ext%
            - %core.adm_relative_path%

    php_ini:
        class: phpbb\php\ini

    plupload:
        class: phpbb\plupload\plupload
        arguments:
            - %core.root_path%
            - @config
            - @request
            - @user
            - @php_ini
            - @mimetype.guesser

    request:
        class: phpbb\request\request

    symfony_request:
        class: phpbb\symfony_request
        arguments:
            - @request

    template:
        class: phpbb\template\twig\twig
        arguments:
            - @path_helper
            - @config
            - @user
            - @template_context
            - @ext.manager

    template_context:
        class: phpbb\template\context

    user:
        class: phpbb\user

    user_loader:
        class: phpbb\user_loader
        arguments:
            - @dbal.conn
            - %core.root_path%
            - %core.php_ext%
            - %tables.users%

    version_helper:
        class: phpbb\version_helper
        scope: prototype
        arguments:
            - @cache
            - @config
            - @user
