<?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">

    <services>
        <!-- Filesystem -->
        <service id="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory">
            <argument type="tagged" tag="shopware.filesystem.factory"/>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.public" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="factory"/>
            <argument>%shopware.filesystem.public%</argument>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.private" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="privateFactory"/>
            <argument>%shopware.filesystem.private%</argument>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.temp" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="privateFactory"/>
            <argument>%shopware.filesystem.temp%</argument>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.theme" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="factory"/>
            <argument>%shopware.filesystem.theme%</argument>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.sitemap" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="factory"/>
            <argument>%shopware.filesystem.sitemap%</argument>
        </service>

        <service class="League\Flysystem\FilesystemOperator" id="shopware.filesystem.asset" public="true">
            <factory service="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory" method="factory"/>
            <argument>%shopware.filesystem.asset%</argument>
        </service>

        <service class="Shopware\Core\Framework\Adapter\Filesystem\Adapter\LocalFactory" id="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory.local">
            <tag name="shopware.filesystem.factory"/>
        </service>

        <service class="Shopware\Core\Framework\Adapter\Filesystem\Adapter\AwsS3v3Factory" id="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory.amazon_s3">
            <tag name="shopware.filesystem.factory"/>
        </service>

        <service class="Shopware\Core\Framework\Adapter\Filesystem\Adapter\GoogleStorageFactory" id="Shopware\Core\Framework\Adapter\Filesystem\FilesystemFactory.google_storage">
            <tag name="shopware.filesystem.factory"/>
        </service>

        <service id="League\Flysystem\PathPrefixing\PathPrefixedAdapter">
            <argument type="service" id="shopware.filesystem.public"/>
            <argument>media</argument>
        </service>

        <service id="console.command.assets_install" class="Shopware\Core\Framework\Adapter\Asset\AssetInstallCommand">
            <argument type="service" id="kernel"/>
            <argument type="service" id="Shopware\Core\Framework\Plugin\Util\AssetService"/>
            <argument type="service" id="Shopware\Core\Framework\App\ActiveAppsLoader"/>
            <tag name="console.command"/>
        </service>

        <!-- Assets -->
        <service id="shopware.asset.public" class="Shopware\Core\Framework\Adapter\Asset\FallbackUrlPackage" lazy="true">
            <argument type="collection">
                <argument>%shopware.filesystem.public.url%</argument>
            </argument>
            <argument type="service" id="assets.empty_version_strategy"/>
            <argument type="service" id="request_stack" on-invalid="null"/>
            <tag name="shopware.asset" asset="public"/>
        </service>

        <service id="shopware.asset.theme.version_strategy" class="Shopware\Core\Framework\Adapter\Asset\FlysystemLastModifiedVersionStrategy">
            <argument>theme-metaData</argument>
            <argument type="service" id="shopware.filesystem.theme"/>
            <argument type="service" id="cache.object"/>
        </service>

        <service id="shopware.asset.asset.version_strategy" class="Shopware\Core\Framework\Adapter\Asset\FlysystemLastModifiedVersionStrategy">
            <argument>asset-metaData</argument>
            <argument type="service" id="shopware.filesystem.asset"/>
            <argument type="service" id="cache.object"/>
        </service>

        <service id="shopware.asset.asset" class="Shopware\Core\Framework\Adapter\Asset\FallbackUrlPackage" lazy="true">
            <argument type="collection">
                <argument>%shopware.filesystem.asset.url%</argument>
            </argument>
            <argument type="service" id="shopware.asset.asset.version_strategy"/>
            <argument type="service" id="request_stack" on-invalid="null"/>
            <tag name="shopware.asset" asset="asset"/>
        </service>

        <service id="shopware.asset.asset_without_versioning" class="Shopware\Core\Framework\Adapter\Asset\FallbackUrlPackage" lazy="true">
            <argument type="collection">
                <argument>%shopware.filesystem.asset.url%</argument>
            </argument>
            <argument type="service" id="assets.empty_version_strategy"/>
            <argument type="service" id="request_stack" on-invalid="null"/>
        </service>

        <service id="shopware.asset.sitemap" class="Shopware\Core\Framework\Adapter\Asset\FallbackUrlPackage" lazy="true">
            <argument type="collection">
                <argument>%shopware.filesystem.sitemap.url%</argument>
            </argument>
            <argument type="service" id="assets.empty_version_strategy"/>
            <argument type="service" id="request_stack" on-invalid="null"/>
            <tag name="shopware.asset" asset="sitemap"/>
        </service>
    </services>
</container>
