imports:
    - { resource: parameters.yml }
    - { resource: security.yml }

# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: en

# Framework configuration
framework:
    esi: { enabled: true }
    translator: { fallbacks: ['%locale%'] }
    secret: '%secret%'
    router:
        resource: 'contao_manager.routing_loader::loadFromPlugins'
        type: service
        strict_requirements: '%kernel.debug%'
    csrf_protection: ~
    lock: ~
    default_locale:  '%locale%'
    session:
        handler_id: ~
    fragments: { path: /_fragment }

# Contao configuration
contao:
    preview_script: '/preview.php'

# Twig configuration
twig:
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    default_path: '%kernel.project_dir%/app/Resources/views'

# Doctrine configuration
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver: pdo_mysql
                host: '%database_host%'
                port: '%database_port%'
                user: '%database_user%'
                password: '%database_password%'
                dbname: '%database_name%'
                charset: utf8mb4
                default_table_options:
                    charset: utf8mb4
                    collate: utf8mb4_unicode_ci
                    engine: InnoDB
                options:
                    !php/const PDO::MYSQL_ATTR_MULTI_STATEMENTS: false
        types:
            binary_string:
                class: 'Contao\CoreBundle\Doctrine\DBAL\Types\BinaryStringType'
    orm:
        auto_mapping: true
        auto_generate_proxy_classes: false
        naming_strategy: doctrine.orm.naming_strategy.default
        metadata_cache_driver:
            type: service
            id: doctrine_cache.providers.doctrine_metadata_cache
        result_cache_driver:
            type: service
            id: doctrine_cache.providers.doctrine_result_cache
        query_cache_driver:
            type: service
            id: doctrine_cache.providers.doctrine_query_cache

# Doctrine cache configuration
doctrine_cache:
    providers:
        doctrine_metadata_cache:
            file_system:
                extension: '.cache'
                directory: '%kernel.cache_dir%/doctrine/metadata'
        doctrine_result_cache:
            file_system:
                extension: '.cache'
                directory: '%kernel.cache_dir%/doctrine/result'
        doctrine_query_cache:
            file_system:
                extension: '.cache'
                directory: '%kernel.cache_dir%/doctrine/query'

# SwiftMailer configuration
swiftmailer:
    default_mailer: default
    mailers:
        default:
            transport: '%mailer_transport%'
            host: '%mailer_host%'
            username: '%mailer_user%'
            password: '%mailer_password%'
            port: '%mailer_port%'
            encryption: '%mailer_encryption%'

# Lexik configuration
lexik_maintenance:
    authorized:
        path: ^/contao($|/)
        attributes:
            _bypass_maintenance: true
    driver:
        class: 'Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver'
        options: { file_path: '%kernel.project_dir%/var/maintenance_lock' }

# Security configuration
nelmio_security:
    clickjacking:
        paths:
            '^/.*': SAMEORIGIN
    content_type:
        nosniff: true
    referrer_policy:
        enabled: true
        policies:
            - 'no-referrer-when-downgrade'
            - 'strict-origin-when-cross-origin'
    xss_protection:
        enabled: true
        mode_block: true

# FOS HttpCache configuration
fos_http_cache:
    proxy_client:
        symfony:
            use_kernel_dispatcher: true
    cache_manager:
        enabled: true
    tags:
        enabled: true
        annotations:
            enabled: false
        max_header_value_length: 4096
