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