# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.

imports:
    - { resource: "@SyliusAddressingBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusAttributeBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusChannelBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusCurrencyBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusCustomerBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusInventoryBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusLocaleBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusOrderBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusPaymentBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" }
    - { resource: "@SyliusProductBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusPromotionBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusShippingBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusTaxationBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusTaxonomyBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusUserBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusUiBundle/Resources/config/app/config.yml" }

    - { resource: "@SyliusCoreBundle/Resources/config/app/parameters.yml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/sylius.yml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/state_machine.yml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/workflow.yaml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/fixtures.yml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/messenger.yaml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/nyholm_psr7.yaml" }
    - { resource: "@SyliusCoreBundle/Resources/config/app/doctrine_migrations.yaml" }

parameters:
    sylius_core.public_dir: "%kernel.project_dir%/web"
    sylius_core.images_dir: "%sylius_core.public_dir%/media/image"
    locale: en_US

sylius_core:
    orders_statistics:
        intervals_map:
            day:
                interval: P1D
                period_format: Y-m-d
            month:
                interval: P1M
                period_format: Y-m
            year:
                interval: P1Y
                period_format: Y

doctrine:
    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        entity_managers:
            default:
                auto_mapping: true
                dql:
                    string_functions:
                        DATE_FORMAT: Sylius\Bundle\CoreBundle\Doctrine\DQL\DateFormat
                        DAY: Sylius\Bundle\CoreBundle\Doctrine\DQL\Day
                        HOUR: Sylius\Bundle\CoreBundle\Doctrine\DQL\Hour
                        MONTH: Sylius\Bundle\CoreBundle\Doctrine\DQL\Month
                        WEEK: Sylius\Bundle\CoreBundle\Doctrine\DQL\Week
                        YEAR: Sylius\Bundle\CoreBundle\Doctrine\DQL\Year

flysystem:
    storages:
        sylius.storage:
            adapter: 'local'
            options:
                directory: '%sylius_core.images_dir%'
            directory_visibility: 'public'

knp_gaufrette:
    adapters:
        sylius_image:
            local:
                directory: "%sylius_core.images_dir%"
                create: true
    filesystems:
        sylius_image:
            adapter: "%sylius.uploader.filesystem%"

liip_imagine:
    loaders:
        default:
            filesystem:
                data_root: "%sylius_core.images_dir%"
    resolvers:
        default:
            web_path:
                web_root: "%sylius_core.public_dir%"
                cache_prefix: "media/cache"
    filter_sets:
        sylius_original: ~
        sylius_small:
            filters:
                thumbnail: { size: [120, 90], mode: outbound }
        sylius_medium:
            filters:
                thumbnail: { size: [240, 180], mode: outbound }
        sylius_large:
            filters:
                thumbnail: { size: [640, 480], mode: outbound }

payum:
    storages:
        "%sylius.model.order.class%": { doctrine: orm }
        "%sylius.model.payment.class%": { doctrine: orm }

    security:
        token_storage:
            Sylius\Bundle\PayumBundle\Model\PaymentSecurityToken: { doctrine: orm }

    dynamic_gateways:
        config_storage:
            Sylius\Bundle\PayumBundle\Model\GatewayConfig: { doctrine: orm }

    gateways:
        offline:
            factory: offline

stof_doctrine_extensions:
    default_locale: "%locale%"
    orm:
        default:
            tree: true
            sluggable: true
            timestampable: true
            loggable: true
            sortable: true

twig:
    debug: "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    globals:
        sylius: "@sylius.context.shopper"
        sylius_base_locale: "%locale%"
        sylius_meta:
            version: !php/const Sylius\Bundle\CoreBundle\SyliusCoreBundle::VERSION

sonata_block:
    blocks:
        sonata.block.service.template:
            settings:
                address: ~
                addresses: ~
                cart: ~
                channel: ~
                customer: ~
                form: ~
                order: ~
                order_item: ~
                orders: ~
                product: ~
                product_review: ~
                product_reviews: ~
                products: ~
                resource: ~
                resources: ~
                statistics: ~
                taxon: ~
