<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="fos_http_cache.cache_manager.class">FOS\HttpCacheBundle\CacheManager</parameter>
        <parameter key="fos_http_cache.event_listener.log.class">FOS\HttpCache\EventListener\LogSubscriber</parameter>
        <parameter key="fos_http_cache.command.invalidate_path.class">FOS\HttpCacheBundle\Command\InvalidatePathCommand</parameter>
        <parameter key="fos_http_cache.command.invalidate_regex.class">FOS\HttpCacheBundle\Command\InvalidateRegexCommand</parameter>
        <parameter key="fos_http_cache.command.refresh_path.class">FOS\HttpCacheBundle\Command\RefreshPathCommand</parameter>
    </parameters>

    <services>
        <service id="fos_http_cache.cache_manager"
                 class="%fos_http_cache.cache_manager.class%">
            <argument type="service" id="fos_http_cache.default_proxy_client" />
            <argument type="service" id="router" />
            <call method="setEventDispatcher">
                <argument id="event_dispatcher" type="service" on-invalid="ignore" />
            </call>
            <call method="setGenerateUrlType">
                <argument>%fos_http_cache.cache_manager.generate_url_type%</argument>
            </call>
        </service>

        <service id="fos_http_cache.event_listener.log"
                 class="%fos_http_cache.event_listener.log.class%"
                 abstract="true">
            <argument type="service" id="logger" />
        </service>

        <!-- for symfony < 2.4 the command will be instantiated by the framework and the command services are ignored -->

        <service id="fos_http_cache.command.invalidate_path" class="%fos_http_cache.command.invalidate_path.class%">
            <argument type="service" id="fos_http_cache.cache_manager" />
            <tag name="console.command"/>
        </service>

        <service id="fos_http_cache.command.invalidate_regex" class="%fos_http_cache.command.invalidate_regex.class%">
            <argument type="service" id="fos_http_cache.cache_manager" />
            <tag name="console.command"/>
        </service>

        <service id="fos_http_cache.command.refresh_path" class="%fos_http_cache.command.refresh_path.class%">
            <argument type="service" id="fos_http_cache.cache_manager" />
            <tag name="console.command"/>
        </service>
    </services>

</container>
