Files

133 lines
7.5 KiB
XML
Executable File

<?xml version="1.0"?>
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_GeoIPLookup
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Plumrocket\GeoIPLookup\Api\GeoIPLookupInterface" type="Plumrocket\GeoIPLookup\Model\Api\GeoIPLookup" />
<preference for="Plumrocket\GeoIPLookup\Api\GeoLocationValidatorInterface" type="Plumrocket\GeoIPLookup\Model\GeoLocationValidator" />
<preference for="Plumrocket\GeoIPLookup\Api\LocationsListInterface" type="Plumrocket\GeoIPLookup\Model\LocationsList" />
<preference for="Plumrocket\GeoIPLookup\Model\Cache\GeoIpInterface" type="Plumrocket\GeoIPLookup\Model\Cache\Session" />
<type name="Plumrocket\CCPA\Model\Validator\CcpaGeoLocationValidator">
<arguments>
<argument name="geoIpModel" xsi:type="object">Plumrocket\GeoIPLookup\Model\GeoIPLookup</argument>
</arguments>
</type>
<type name="Plumrocket\GeoIPLookup\Plugin\Plumrocket\CanManageCookie">
<arguments>
<argument name="geoLocationValidator" xsi:type="object">Plumrocket\GeoIPLookup\Api\GeoLocationValidatorInterface\Proxy</argument>
</arguments>
</type>
<type name="Plumrocket\CookieConsent\Api\CanManageCookieInterface">
<plugin name="prGeoIpCanManageCookie"
type="Plumrocket\GeoIPLookup\Plugin\Plumrocket\CanManageCookie" sortOrder="10"/>
</type>
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<argument name="alternativeHeaders" xsi:type="array">
<item name="cloud-flare-real-visitor-ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
</argument>
</arguments>
</type>
<type name="Plumrocket\DataPrivacyApi\Api\ConsentCheckboxProviderInterface">
<plugin name="pr-geo-ip-filter-checkboxes"
type="Plumrocket\GeoIPLookup\Plugin\Plumrocket\DataPrivacy\FilterConsentCheckboxesPlugin"
sortOrder="10"/>
</type>
<virtualType name="Plumrocket\GeoIPLookup\Model\Services\IpToCountry\DbReader" type="Plumrocket\GeoIPLookup\Model\MmdbReader">
<arguments>
<argument name="fileName" xsi:type="const">Plumrocket\GeoIPLookup\Helper\Config::IPTOCOUNTRY_SOURCE_FILE_NAME</argument>
<argument name="databaseName" xsi:type="const">Plumrocket\GeoIPLookup\Helper\Config::IPTOCOUNTRY_DATABASE_NAME</argument>
<argument name="fieldsMap" xsi:type="array">
<item name="continent_code" xsi:type="string">continent.code</item>
<item name="continent_name" xsi:type="string">continent.names.en</item>
<item name="country_code" xsi:type="string">country.iso_code</item>
<item name="country_name" xsi:type="string">country.names.en</item>
<item name="is_in_european_union" xsi:type="string">country.is_in_european_union</item>
</argument>
</arguments>
</virtualType>
<virtualType name="Plumrocket\GeoIPLookup\Model\Services\MaxMind\DbReader" type="Plumrocket\GeoIPLookup\Model\MmdbReader">
<arguments>
<argument name="fileName" xsi:type="const">Plumrocket\GeoIPLookup\Helper\Config::MAXMIND_SOURCE_FILE_NAME</argument>
<argument name="databaseName" xsi:type="const">Plumrocket\GeoIPLookup\Helper\Config::MAXMIND_DATABASE_NAME</argument>
<argument name="fieldsMap" xsi:type="array">
<item name="postal_code" xsi:type="string">postal.code</item>
<item name="latitude" xsi:type="string">location.latitude</item>
<item name="longitude" xsi:type="string">location.longitude</item>
<item name="continent_code" xsi:type="string">continent.code</item>
<item name="continent_name" xsi:type="string">continent.names.en</item>
<item name="country_code" xsi:type="string">country.iso_code</item>
<item name="country_name" xsi:type="string">country.names.en</item>
<item name="subdivision_1_iso_code" xsi:type="string">subdivisions.0.iso_code</item>
<item name="subdivision_1_name" xsi:type="string">subdivisions.0.names.en</item>
<item name="subdivision_2_iso_code" xsi:type="string">subdivisions.1.iso_code</item>
<item name="subdivision_2_name" xsi:type="string">subdivisions.1.names.en</item>
<item name="city_name" xsi:type="string">city.names.en</item>
<item name="time_zone" xsi:type="string">location.time_zone</item>
<item name="is_in_european_union" xsi:type="string">country.is_in_european_union</item>
</argument>
</arguments>
</virtualType>
<virtualType name="Plumrocket\GeoIPLookup\Model\Services\IpToCountry" type="Plumrocket\GeoIPLookup\Model\Services\AbstractMmdb">
<arguments>
<argument name="mmdbReader" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\IpToCountry\DbReader</argument>
<argument name="cacheKeyPostfixes" xsi:type="array">
<item name="getGeoLocation" xsi:type="string">_gl_itc</item>
<item name="getCountryCode" xsi:type="string">_cc_itc</item>
<item name="getCurrentCountryState" xsi:type="string">_cc_itc_cs</item>
</argument>
</arguments>
</virtualType>
<virtualType name="Plumrocket\GeoIPLookup\Model\Services\MaxMind" type="Plumrocket\GeoIPLookup\Model\Services\AbstractMmdb">
<arguments>
<argument name="mmdbReader" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\MaxMind\DbReader</argument>
<argument name="cacheKeyPostfixes" xsi:type="array">
<item name="getGeoLocation" xsi:type="string">_gl_mx</item>
<item name="getCountryCode" xsi:type="string">_cc_mx</item>
<item name="getCurrentCountryState" xsi:type="string">_cc_mx_cs</item>
</argument>
</arguments>
</virtualType>
<type name="Plumrocket\GeoIPLookup\Model\GeoIPLookup">
<arguments>
<argument name="geoIpServices" xsi:type="array">
<item name="MaxMind" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\MaxMind</item>
<item name="IpToCountry" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\IpToCountry</item>
<item name="IpApi" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\IpApi</item>
</argument>
</arguments>
</type>
<type name="Plumrocket\GeoIPLookup\Model\Data\Import\Iptocountry">
<arguments>
<argument name="mmdbReader" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\IpToCountry\DbReader</argument>
</arguments>
</type>
<type name="Plumrocket\GeoIPLookup\Model\Data\Import\Maxmindgeoip">
<arguments>
<argument name="mmdbReader" xsi:type="object">Plumrocket\GeoIPLookup\Model\Services\MaxMind\DbReader</argument>
</arguments>
</type>
</config>