imports:
  - { resource: set_parameters.php }
  - { resource: services.yml }
  - { resource: addons/*.yml }
  - { resource: doctrine.yml }
  - { resource: messenger.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:
  env(PS_THEME_NAME): "classic"
  translator.class: PrestaShopBundle\Translation\Translator
  translator.data_collector: PrestaShopBundle\Translation\DataCollectorTranslator
  prestashop_views: "%kernel.project_dir%/src/PrestaShopBundle/Resources/views"
  admin_page: "%prestashop_views%/Admin"
  env(PS_LOG_OUTPUT): "%kernel.logs_dir%/%kernel.environment%.log"
  env(PS_LOG_MAX_FILES): '30'
  env(PS_TRUSTED_PROXIES): ''
  mail_themes_uri: "/mails/themes"
  mail_themes_dir: "%kernel.project_dir%%mail_themes_uri%"
  modules_translation_paths: [ ]
  prestashop.controllers_all_shop_context:
    - AdminAccess
    - AdminFeatureFlag
    - AdminLanguages
    - AdminProfiles
    - AdminSpecificPriceRule
    - AdminStatuses
    - AdminSecurity
    - AdminSecuritySessionEmployee
    - AdminSecuritySessionCustomer
    - AdminTranslations

# Autowires Core controllers
services:
  logger:
    alias: monolog.logger
    public: true

framework:
  # proxies configuration, see https://symfony.com/doc/current/deployment/proxies.html
  trusted_proxies: '%env(PS_TRUSTED_PROXIES)%'

  assets:
    version: !php/const PrestaShop\PrestaShop\Core\Version::VERSION
    packages:
      front_js:
        base_path: '../js'

  # esi: ~
  secret: "%secret%"
  translator:
    fallbacks: [ "default" ]
    paths: "%modules_translation_paths%"
  form: ~
  csrf_protection: ~
  validation: { enable_attributes: true }
  serializer: { enable_attributes: true }
  default_locale: "%locale%"
  trusted_hosts: ~
  session:
    handler_id: ~
  fragments: ~
  http_method_override: true
  http_client: ~
  cache:
    pools:
      '%cache.driver%':
        adapter: '%cache.adapter%'

# Monolog configuration
monolog:
  handlers:
    main:
      type: rotating_file
      max_files: '%env(int:PS_LOG_MAX_FILES)%'
      path: '%env(PS_LOG_OUTPUT)%'
      level: notice
    legacy:
      type: service
      id: prestashop.handler.log
      level: warning
      channels: [ app ]

# Twig Configuration
twig:
  autoescape: "name"
  debug: "%kernel.debug%"
  strict_variables: "%kernel.debug%"
  exception_controller: null
  form_themes:
    - '@PrestaShop/Admin/TwigTemplateForm/bootstrap_4_horizontal_layout.html.twig'
  paths:
    '%admin_page%/TwigTemplateForm': Twig
    '%admin_page%/Common': Common
    '%admin_page%/Configure/AdvancedParameters': AdvancedParameters
    '%admin_page%/Configure/ShopParameters': ShopParameters
    '%kernel.project_dir%/modules': Modules
    '%mail_themes_dir%': MailThemes
    '%prestashop_views%': PrestaShopCore
    '%prestashop.admin_dir%/themes/new-theme': AdminNewTheme
  globals:
    ps: '@PrestaShopBundle\Twig\Layout\PrestaShopLayoutGlobalVariables'
    webpack_server: false
    multistore_field_prefix: !php/const PrestaShopBundle\Service\Form\MultistoreCheckboxEnabler::MULTISTORE_FIELD_PREFIX
    modify_all_shops_prefix: !php/const PrestaShopBundle\Form\Extension\ModifyAllShopsExtension::MODIFY_ALL_SHOPS_PREFIX
    disabling_switch_prefix: !php/const PrestaShopBundle\Form\Extension\DisablingSwitchExtension::FIELD_PREFIX

api_platform:
  # API docs is disabled in the Admin environment, it is accessible via the oauth dedicated endpoint
  enable_docs: false
  enable_entrypoint: false
  enable_swagger: false
  enable_swagger_ui: false
  # We define mapping in this common config because even though the API routes are only accessible via the admin-api endpoint we still need
  # to parse the Api Platform resources to extract the scopes in the back-office
  mapping:
    paths:
      - '%kernel.project_dir%/src/PrestaShopBundle/ApiPlatform/Resources'
