<?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="router.options.generator_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
        <parameter key="router.options.generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
        <parameter key="router.options.generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</parameter>
        <parameter key="router.options.matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
        <parameter key="router.options.matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
        <parameter key="router.options.matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</parameter>
        <parameter key="router.options.matcher.cache_class">%router.cache_class_prefix%UrlMatcher</parameter>
        <parameter key="router.options.generator.cache_class">%router.cache_class_prefix%UrlGenerator</parameter>
        <parameter key="router.request_context.host">localhost</parameter>
        <parameter key="router.request_context.scheme">http</parameter>
        <parameter key="router.request_context.base_url"></parameter>
    </parameters>

    <services>
        <defaults public="false" />

        <service id="routing.resolver" class="Symfony\Component\Config\Loader\LoaderResolver" />

        <service id="routing.loader.xml" class="Symfony\Component\Routing\Loader\XmlFileLoader">
            <tag name="routing.loader" />
            <argument type="service" id="file_locator" />
        </service>

        <service id="routing.loader.yml" class="Symfony\Component\Routing\Loader\YamlFileLoader">
            <tag name="routing.loader" />
            <argument type="service" id="file_locator" />
        </service>

        <service id="routing.loader.php" class="Symfony\Component\Routing\Loader\PhpFileLoader">
            <tag name="routing.loader" />
            <argument type="service" id="file_locator" />
        </service>

        <service id="routing.loader.glob" class="Symfony\Component\Config\Loader\GlobFileLoader">
            <tag name="routing.loader" />
            <argument type="service" id="file_locator" />
        </service>

        <service id="routing.loader.directory" class="Symfony\Component\Routing\Loader\DirectoryLoader">
            <tag name="routing.loader" />
            <argument type="service" id="file_locator" />
        </service>

        <service id="routing.loader.service" class="Symfony\Component\Routing\Loader\DependencyInjection\ServiceRouterLoader">
            <tag name="routing.loader" />
            <argument type="service" id="service_container" />
        </service>

        <service id="routing.loader" class="Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader" public="true">
            <argument type="service" id="controller_name_converter" />
            <argument type="service" id="routing.resolver" />
        </service>

        <service id="router.default" class="Symfony\Bundle\FrameworkBundle\Routing\Router">
            <tag name="monolog.logger" channel="router" />
            <argument type="service" id="service_container" />
            <argument>%router.resource%</argument>
            <argument type="collection">
                <argument key="cache_dir">%kernel.cache_dir%</argument>
                <argument key="debug">%kernel.debug%</argument>
                <argument key="generator_class">%router.options.generator_class%</argument>
                <argument key="generator_base_class">%router.options.generator_base_class%</argument>
                <argument key="generator_dumper_class">%router.options.generator_dumper_class%</argument>
                <argument key="generator_cache_class">%router.options.generator.cache_class%</argument>
                <argument key="matcher_class">%router.options.matcher_class%</argument>
                <argument key="matcher_base_class">%router.options.matcher_base_class%</argument>
                <argument key="matcher_dumper_class">%router.options.matcher_dumper_class%</argument>
                <argument key="matcher_cache_class">%router.options.matcher.cache_class%</argument>
            </argument>
            <argument type="service" id="router.request_context" on-invalid="ignore" />
            <argument type="service" id="logger" on-invalid="ignore" />
            <call method="setConfigCacheFactory">
                <argument type="service" id="config_cache_factory" />
            </call>
        </service>

        <service id="router" alias="router.default" public="true" />
        <service id="Symfony\Component\Routing\RouterInterface" alias="router" />
        <service id="Symfony\Component\Routing\Generator\UrlGeneratorInterface" alias="router" />
        <service id="Symfony\Component\Routing\Matcher\UrlMatcherInterface" alias="router" />

        <service id="router.request_context" class="Symfony\Component\Routing\RequestContext">
            <argument>%router.request_context.base_url%</argument>
            <argument>GET</argument>
            <argument>%router.request_context.host%</argument>
            <argument>%router.request_context.scheme%</argument>
            <argument>%request_listener.http_port%</argument>
            <argument>%request_listener.https_port%</argument>
        </service>
        <service id="Symfony\Component\Routing\RequestContext" alias="router.request_context" />

        <service id="router.cache_warmer" class="Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer">
            <tag name="kernel.cache_warmer" />
            <argument type="service" id="router" />
        </service>

        <service id="router_listener" class="Symfony\Component\HttpKernel\EventListener\RouterListener" public="true">
            <tag name="kernel.event_subscriber" />
            <tag name="monolog.logger" channel="request" />
            <argument type="service" id="router" />
            <argument type="service" id="request_stack" />
            <argument type="service" id="router.request_context" on-invalid="ignore" />
            <argument type="service" id="logger" on-invalid="ignore" />
        </service>
    </services>
</container>
