<?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="env(SHOPWARE_DISABLE_UPDATE_CHECK)" />
    </parameters>
    <services>
        <service id="Shopware\Core\Framework\Update\Api\UpdateController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Update\Services\ApiClient"/>
            <argument type="service" id="Shopware\Core\Framework\Update\Checkers\WriteableCheck" />
            <argument type="service" id="Shopware\Core\Framework\Update\Checkers\LicenseCheck" />
            <argument type="service" id="Shopware\Core\Framework\Update\Services\ExtensionCompatibility" />
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\ExtensionLifecycleService"/>
            <argument>%kernel.shopware_version%</argument>
            <argument>%env(bool:SHOPWARE_DISABLE_UPDATE_CHECK)%</argument>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Framework\Update\Services\ApiClient">
            <argument type="service" id="http_client"/>
            <argument>%shopware.auto_update.enabled%</argument>
            <argument>%kernel.shopware_version%</argument>
            <argument>%kernel.project_dir%</argument>
        </service>

        <service id="Shopware\Core\Framework\Update\Services\ExtensionCompatibility">
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\AbstractExtensionDataProvider"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\Framework\Update\Services\Filesystem"/>

        <service id="Shopware\Core\Framework\Update\Checkers\WriteableCheck">
            <argument type="service" id="Shopware\Core\Framework\Update\Services\Filesystem"/>
            <argument>%kernel.project_dir%</argument>
            <tag name="shopware.update_api.checker" priority="3"/>
        </service>

        <service id="Shopware\Core\Framework\Update\Checkers\LicenseCheck">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Framework\Store\Services\StoreClient"/>
            <tag name="shopware.update_api.checker" priority="4"/>
        </service>

        <service id="Shopware\Core\Framework\Update\Services\UpdateHtaccess">
            <argument>%kernel.project_dir%/public/.htaccess</argument>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Framework\Update\Subscriber\UpdateSubscriber">
            <argument type="service" id="Shopware\Core\Framework\Notification\NotificationService" />
            <tag name="kernel.event_subscriber"/>
        </service>
    </services>
</container>
