-
Notifications
You must be signed in to change notification settings - Fork 17
/
di.xml
58 lines (58 loc) · 3.22 KB
/
di.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="CF\Integration\ConfigInterface" type="CloudFlare\Plugin\Backend\MagentoConfig" />
<type name="CloudFlare\Plugin\Backend\MagentoAPI">
<arguments>
<argument name="configReader" xsi:type="object">\Magento\Framework\App\DeploymentConfig\Reader</argument>
<argument name="keyValueFactory" xsi:type="object">\CloudFlare\Plugin\Model\KeyValueFactory</argument>
<argument name="storeManager" xsi:type="object">\Magento\Store\Model\StoreManagerInterface</argument>
<argument name="logger" xsi:type="object">\Psr\Log\LoggerInterface</argument>
</arguments>
</type>
<preference for="CF\Integration\IntegrationAPIInterface" type="CloudFlare\Plugin\Backend\MagentoAPI" />
<type name="CloudFlare\Plugin\Backend\DataStore">
<arguments>
<argument name="magentoAPI" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoAPI</argument>
</arguments>
</type>
<type name="CloudFlare\Plugin\Backend\MagentoHttpClient">
<arguments>
<argument name="logger" xsi:type="object">\Psr\Log\LoggerInterface</argument>
</arguments>
</type>
<preference for="CF\Integration\DataStoreInterface" type="CloudFlare\Plugin\Backend\DataStore" />
<type name="CloudFlare\Plugin\Backend\MagentoIntegration">
<arguments>
<argument name="config" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoConfig</argument>
<argument name="integrationAPI" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoAPI</argument>
<argument name="dataStore" xsi:type="object">\CloudFlare\Plugin\Backend\DataStore</argument>
<argument name="logger" xsi:type="object">\Psr\Log\LoggerInterface</argument>
<argument name="httpClient" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoHttpClient</argument>
</arguments>
</type>
<preference for="CF\Integration\IntegrationInterface" type="CloudFlare\Plugin\Backend\MagentoIntegration" />
<!-- PI-1074 - revert when Magnento 2.2 is released -->
<!--
<type name="CloudFlare\Plugin\Backend\ClientAPI">
<arguments>
<argument name="integration" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoIntegration</argument>
</arguments>
</type>
<type name="CF\API\Plugin">
<arguments>
<argument name="integration" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoIntegration</argument>
</arguments>
</type>
<type name="CF\Router\RequestRouter">
<arguments>
<argument name="integrationContext" xsi:type="object">\CloudFlare\Plugin\Backend\MagentoIntegration</argument>
</arguments>
</type> -->
<!-- Restore original visitor IP from CloudFlare header -->
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<argument name="alternativeHeaders" xsi:type="array">
<item name="http_cf_connecting_ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
</argument>
</arguments>
</type>
</config>