parameters:
    env(PHPCR_WORKSPACE): 'default'

sulu_document_manager:
    versioning:
        enabled: false # See https://docs.sulu.io/en/2.0/bundles/page/versioning.html if you want to enable versioning
    sessions:
        # See https://docs.sulu.io/en/2.0/cookbook/jackrabbit.html if you want to use Jackrabbit
        default:
            backend:
                type: doctrinedbal
            workspace: "%env(PHPCR_WORKSPACE)%"
        live:
            backend:
                type: doctrinedbal
            workspace: "%env(PHPCR_WORKSPACE)%_live"

when@prod: &prod
    sulu_document_manager:
        sessions:
            default:
                backend:
                    caches:
                        meta: doctrine_phpcr.meta_cache_provider
                        nodes: doctrine_phpcr.nodes_cache_provider
            live:
                backend:
                    caches:
                        meta: doctrine_phpcr.meta_cache_provider
                        nodes: doctrine_phpcr.nodes_cache_provider

    services:
        doctrine_phpcr.meta_cache_provider:
            class: Symfony\Component\Cache\Psr16Cache
            public: false
            arguments:
                - '@doctrine_phpcr.meta_cache_pool'
            tags:
                - { name: 'kernel.reset', method: 'reset' }

        doctrine_phpcr.nodes_cache_provider:
            class: Symfony\Component\Cache\Psr16Cache
            public: false
            arguments:
                - '@doctrine_phpcr.nodes_cache_pool'
            tags:
                - { name: 'kernel.reset', method: 'reset' }

    framework:
        cache:
            pools:
                doctrine_phpcr.meta_cache_pool:
                    adapter: cache.app

                doctrine_phpcr.nodes_cache_pool:
                    adapter: cache.app

when@stage: *prod
