imports:
    - { resource: parameters.yml }
    - { resource: services.yml }
    - { resource: "@LifeStyleToolsCachingBundle/Resources/config/services.yml" }

framework:
    translator:      { fallback: "%locale%" }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        handler_id: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
    fragments:       ~
    http_method_override: true
    profiler: { only_exceptions: true }
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    form_themes:
        - 'bootstrap_3_layout.html.twig'
    globals:
        webserviceversion: "1.0.0"

# Session storage in db
services:
    Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
            public:    false
            arguments:
                - '%database_spsession_dsn%'
                - { db_table: backend_session, db_id_col: session_id, db_data_col: session_value, db_time_col: session_time, db_lifetime_col: session_lifetime, db_username: '%database_spsession_user%', db_password: '%database_spsession_password%' }

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ ]
    filters:
        cssrewrite: ~


# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

# Doctrine Configuration
doctrine:
    dbal:
        default_connection: Backend
        connections:
            Backend:
                driver:   "%database_backend_driver%"
                host:     "%database_backend_host%"
                port:     "%database_backend_port%"
                dbname:   "%database_backend_name%"
                user:     "%database_backend_user%"
                password: "%database_backend_password%"
                charset:  UTF8
    orm:
        default_entity_manager: Backend
        entity_managers:
            Backend:
                connection: Backend
                mappings:
                    LifeStyleToolsBackendSecurityBundle:  ~
                    FOSUserBundle: ~
                    LifeStyleToolsDbLogBundle:  ~

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: LifeStyle\Tools\BackendSecurityBundle\Entity\User
    from_email:
        address: sb@life-style.de
        sender_name: me

fos_rest:
    param_fetcher_listener: true
    body_listener: true
    versioning: false
    format_listener:
        rules:
            - { path: ^/, priorities: [ html, json, xml ], fallback_format: ~, prefer_extension: true }

    body_converter:
        enabled: true
        validate: true
    view:
        view_response_listener: 'force'
        formats:
            xml:  true
            json: true
            html: true
        templating_formats:
            html: true
    exception:
        codes:
            'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404
            'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT
        messages:
            'Symfony\Component\Routing\Exception\ResourceNotFoundException': true
    allowed_methods_listener: true
    access_denied_listener:
        json: false
    disable_csrf_role: ROLE_API

jms_serializer:
    handlers:
      datetime:
        default_format: 'Y-m-d\TH:i:sP'
        default_timezone: "UTC"

nelmio_api_doc:
    name: 'SSO REST API (1.0.0)'
    default_sections_opened: false

life_style_tools_rest_auth:
    service_url: 'http://sso-idp.dh.test.life-style.de/service/'

sso_rest:
    user_identifier:
        base_url: 'http://sso-idp.dh.test.life-style.de'
        action:  '/service/'
    user_webservice:
        base_url: 'http://sso-uws.dh.test.life-style.de'
        action:  ''
    object_webservice:
        base_url: 'http://sso-ows.dh.test.life-style.de'
        action:  ''
    scope_config:
        scope_application_name: 'ScopeObjects'
        scope_attributes: ['primary', 'secondary']

life_style_tools_caching:
    cache_enabled: true
    caching_engine: apc  # valid values: apc|memcache
    default_ttl: 60
    memcache_host: 10.20.200.61
    memcache_port: 11211
