forked from fastly/fastly-magento2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdi.xml
91 lines (87 loc) · 4.49 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0"?>
<!--
/**
* Fastly CDN for Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Fastly CDN for Magento End User License Agreement
* that is bundled with this package in the file LICENSE_FASTLY_CDN.txt.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Fastly CDN to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to http://www.magento.com for more information.
*
* @category Fastly
* @package Fastly_Cdn
* @copyright Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com)
* @license BSD, see LICENSE_FASTLY_CDN.txt
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\PageCache\Model\Config">
<plugin name="fastly_emulate_varnish_cache_type" type="Fastly\Cdn\Model\PageCache\ConfigPlugin"/>
</type>
<type name="Magento\CacheInvalidate\Model\PurgeCache">
<plugin name="fastly_disable_varnish_calls" type="Fastly\Cdn\Model\PageCache\PurgeCachePlugin" />
</type>
<type name="Magento\Catalog\Block\Product\Image">
<plugin name="fastly_adaptive_pixel_ratio" type="Fastly\Cdn\Plugin\AdaptivePixelRatioPlugin" />
</type>
<type name="Magento\Catalog\Block\Product\View\Gallery">
<plugin name="fastly_adaptive_pixel_ratio_on_pgp" type="Fastly\Cdn\Plugin\GalleryPlugin" />
</type>
<type name="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable">
<plugin name="fastly_adaptive_pixel_ratio_on_pgp_configurable" type="Fastly\Cdn\Plugin\Block\Product\View\Type\ConfigurablePlugin" />
</type>
<type name="Magento\Framework\Console\CommandList">
<arguments>
<argument name="commands" xsi:type="array">
<item name="EnableCommand" xsi:type="object">Fastly\Cdn\Console\Command\EnableCommand</item>
<item name="generateFastlyVclCommand" xsi:type="object">Fastly\Cdn\Console\Command\GenerateVclCommand</item>
<item name="ImportConfigCommand" xsi:type="object">Fastly\Cdn\Console\Command\ConfigImportCommand</item>
<item name="SerializeToJson" xsi:type="object">Fastly\Cdn\Console\Command\SerializeToJson</item>
<item name="JsonToSerialize" xsi:type="object">Fastly\Cdn\Console\Command\JsonToSerialize</item>
<item name="ConfigGetCommand" xsi:type="object">Fastly\Cdn\Console\Command\ConfigGetCommand</item>
<item name="SuperUserCommand" xsi:type="object">Fastly\Cdn\Console\Command\SuperUserCommand</item>
</argument>
</arguments>
</type>
<type name="Magento\Framework\View\Asset\Minification">
<plugin name="fastly_exclude" type="Fastly\Cdn\Plugin\ExcludeFilesFromMinification" />
</type>
<type name="Fastly\Cdn\Model\Api">
<arguments>
<argument name="authSession" xsi:type="object">Magento\Backend\Model\Auth\Session\Proxy</argument>
</arguments>
</type>
<virtualType name="Fastly\Cdn\Model\RateLimit\Logger\Info" type="Magento\Framework\Logger\Handler\Base">
<arguments>
<argument name="fileName" xsi:type="string">/var/log/fastly-rate-limit.log</argument>
</arguments>
</virtualType>
<virtualType name="Fastly\Cdn\Model\RateLimit\Logger" type="Magento\Framework\Logger\Monolog">
<arguments>
<argument name="handlers" xsi:type="array">
<item name="info" xsi:type="object">Fastly\Cdn\Model\RateLimit\Logger\Info</item>
</argument>
</arguments>
</virtualType>
<type name="Fastly\Cdn\Model\FrontControllerPlugin">
<arguments>
<argument name="logger" xsi:type="object">Fastly\Cdn\Model\RateLimit\Logger</argument>
</arguments>
</type>
<preference for="\Magento\Catalog\Model\Product\Image" type="Fastly\Cdn\Model\Product\Image" />
<preference for="\Magento\Catalog\Model\View\Asset\Image" type="Fastly\Cdn\Model\View\Asset\Image" />
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<argument name="alternativeHeaders" xsi:type="array">
<item name="fastly-client-ip" xsi:type="string">HTTP_FASTLY_CLIENT_IP</item>
</argument>
</arguments>
</type>
<preference for="Fastly\Cdn\Model\Resolver\GeoIP\CountryCodeProviderInterface" type="Fastly\Cdn\Model\Resolver\GeoIP\HttpCountryProvider" />
</config>