Skip to content

Commit cffca96

Browse files
committed
move global declaration from module to app/etc/di.xml
1 parent eee0a86 commit cffca96

File tree

9 files changed

+83
-97
lines changed

9 files changed

+83
-97
lines changed

app/code/Magento/Backend/etc/di.xml

-16
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,6 @@
7777
</arguments>
7878
</type>
7979
<preference for="Magento\Framework\Authorization\PolicyInterface" type="Magento\Framework\Authorization\Policy\Acl"/>
80-
<preference for="Magento\Framework\Acl\AclResource\ProviderInterface" type="Magento\Framework\Acl\AclResource\Provider"/>
81-
<type name="Magento\Framework\Acl\AclResource\Config\Reader\Filesystem">
82-
<arguments>
83-
<argument name="converter" xsi:type="object">Magento\Framework\Acl\AclResource\Config\Converter\Dom</argument>
84-
</arguments>
85-
</type>
86-
<type name="Magento\Framework\Acl\AclResource\Provider">
87-
<arguments>
88-
<argument name="configReader" xsi:type="object">Magento\Framework\Acl\AclResource\Config\Reader\Filesystem</argument>
89-
</arguments>
90-
</type>
91-
<type name="Magento\Framework\Acl\Builder">
92-
<arguments>
93-
<argument name="resourceLoader" xsi:type="object">Magento\Framework\Acl\Loader\ResourceLoader</argument>
94-
</arguments>
95-
</type>
9680
<type name="Magento\Framework\Acl\RootResource">
9781
<arguments>
9882
<argument name="identifier" xsi:type="string">Magento_Backend::all</argument>

app/code/Magento/Catalog/etc/di.xml

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
<preference for="Magento\Catalog\Model\Attribute\LockValidatorInterface" type="Magento\Catalog\Model\Attribute\LockValidatorComposite" />
1818
<preference for="Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapperInterface" type="Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapper" />
1919
<preference for="Magento\Catalog\Block\Product\ReviewRendererInterface" type="Magento\Catalog\Block\Product\ReviewRenderer\DefaultProvider" />
20-
<preference for="Magento\Framework\Pricing\PriceInfoInterface" type="Magento\Framework\Pricing\PriceInfo\Base" />
2120
<preference for="Magento\Framework\Pricing\PriceCurrencyInterface" type="Magento\Directory\Model\PriceCurrency" />
22-
<preference for="Magento\Framework\Pricing\Adjustment\CalculatorInterface" type="Magento\Framework\Pricing\Adjustment\Calculator" />
2321
<preference for="Magento\Catalog\Api\Data\CategoryInterface" type="Magento\Catalog\Model\Category" />
2422
<preference for="Magento\Catalog\Api\CategoryManagementInterface" type="Magento\Catalog\Model\CategoryManagement" />
2523
<preference for="Magento\Catalog\Api\CategoryRepositoryInterface" type="Magento\Catalog\Model\CategoryRepository" />
@@ -69,7 +67,6 @@
6967
<preference for="Magento\Catalog\Api\Data\ProductRender\ImageInterface" type="Magento\Catalog\Model\ProductRender\Image" />
7068
<preference for="Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface" type="Magento\Catalog\Model\ProductRender\PriceInfo" />
7169
<preference for="Magento\Catalog\Api\Data\ProductRender\FormattedPriceInfoInterface" type="Magento\Catalog\Model\ProductRender\FormattedPriceInfo" />
72-
<preference for="Magento\Framework\Indexer\BatchProviderInterface" type="Magento\Framework\Indexer\BatchProvider" />
7370
<preference for="Magento\Catalog\Model\Indexer\Product\Price\UpdateIndexInterface" type="Magento\Catalog\Model\Indexer\Product\Price\InvalidateIndex" />
7471
<preference for="Magento\Catalog\Model\Product\Gallery\ImagesConfigFactoryInterface" type="Magento\Catalog\Model\Product\Gallery\ImagesConfigFactory" />
7572
<preference for="Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface" type="Magento\Catalog\Model\Product\Configuration\Item\ItemResolverComposite" />
@@ -357,8 +354,6 @@
357354
</argument>
358355
</arguments>
359356
</type>
360-
<type name="Magento\Framework\Pricing\Adjustment\Collection">
361-
</type>
362357
<type name="Magento\Catalog\Model\Product\ReservedAttributeList">
363358
<arguments>
364359
<argument name="productModel" xsi:type="string">\Magento\Catalog\Model\Product</argument>
@@ -1098,6 +1093,7 @@
10981093
</argument>
10991094
</arguments>
11001095
</type>
1096+
<!-- ToDo: Should be a virtual type of Magento\Framework\Data\CollectionModifier -->
11011097
<type name="Magento\Framework\Data\CollectionModifier">
11021098
<arguments>
11031099
<argument name="conditions" xsi:type="array">
@@ -1136,7 +1132,7 @@
11361132
<argument name="priceTableResolver" xsi:type="object">Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver\Proxy</argument>
11371133
<argument name="storeManager" xsi:type="object">Magento\Store\Model\StoreManagerInterface\Proxy</argument>
11381134
<argument name="context" xsi:type="object">Magento\Framework\App\Http\Context\Proxy</argument>
1139-
<!-- Unccomment after fix issue with Proxy generation -->
1135+
<!-- ToDo: Unccomment after fix issue with Proxy generation -->
11401136
<!--<argument name="dimensionModeConfiguration" xsi:type="object">-->
11411137
<!--Magento\Catalog\Model\Indexer\Product\Price\DimensionModeConfiguration\Proxy-->
11421138
<!--</argument>-->

app/code/Magento/Cookie/etc/di.xml

-11
This file was deleted.

app/code/Magento/Cron/etc/di.xml

+1-26
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magento\Cron\Model\ConfigInterface" type="Magento\Cron\Model\Config" />
10-
<preference for="Magento\Framework\Shell\CommandRendererInterface" type="Magento\Framework\Shell\CommandRenderer" />
11-
<preference for="Magento\Framework\Crontab\CrontabManagerInterface" type="Magento\Framework\Crontab\CrontabManager" />
12-
<preference for="Magento\Framework\Crontab\TasksProviderInterface" type="Magento\Framework\Crontab\TasksProvider" />
10+
<preference for="Magento\Cron\Model\DeadlockRetrierInterface" type="Magento\Cron\Model\DeadlockRetrier" />
1311
<type name="Magento\Config\Model\Config\Structure\Converter">
1412
<plugin name="cron_backend_config_structure_converter_plugin" type="Magento\Cron\Model\Backend\Config\Structure\Converter" />
1513
</type>
@@ -49,27 +47,4 @@
4947
</argument>
5048
</arguments>
5149
</type>
52-
<type name="Magento\Framework\App\AreaList">
53-
<arguments>
54-
<argument name="areas" xsi:type="array">
55-
<item name="crontab" xsi:type="null" />
56-
</argument>
57-
</arguments>
58-
</type>
59-
<type name="Magento\Framework\Crontab\CrontabManagerInterface">
60-
<arguments>
61-
<argument name="shell" xsi:type="object">Magento\Framework\App\Shell</argument>
62-
</arguments>
63-
</type>
64-
<type name="Magento\Framework\Crontab\TasksProviderInterface">
65-
<arguments>
66-
<argument name="tasks" xsi:type="array">
67-
<item name="cronMagento" xsi:type="array">
68-
<item name="command" xsi:type="string">{magentoRoot}bin/magento cron:run | grep -v "Ran jobs by schedule" >> {magentoLog}magento.cron.log</item>
69-
<item name="optional" xsi:type="boolean">false</item>
70-
</item>
71-
</argument>
72-
</arguments>
73-
</type>
74-
<preference for="Magento\Cron\Model\DeadlockRetrierInterface" type="Magento\Cron\Model\DeadlockRetrier" />
7550
</config>

app/code/Magento/Email/etc/di.xml

-27
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magento\Framework\Mail\TemplateInterface" type="Magento\Email\Model\Template" />
10-
<preference for="Magento\Framework\Mail\Template\FactoryInterface" type="Magento\Framework\Mail\Template\Factory" />
1110
<preference for="Magento\Framework\Mail\TransportInterface" type="Magento\Email\Model\Transport" />
12-
<preference for="Magento\Framework\Mail\MessageInterface" type="Magento\Framework\Mail\Message" />
1311
<preference for="Magento\Framework\Mail\Template\SenderResolverInterface" type="Magento\Email\Model\Template\SenderResolver" />
1412
<type name="Magento\Email\Model\BackendTemplate">
1513
<arguments>
@@ -75,29 +73,4 @@
7573
</argument>
7674
</arguments>
7775
</type>
78-
<type name="Magento\Framework\Filter\Template">
79-
<arguments>
80-
<argument name="directiveProcessors" xsi:type="array">
81-
<item name="depend" sortOrder="100" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\DependDirective</item>
82-
<item name="if" sortOrder="200" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\IfDirective</item>
83-
<item name="template" sortOrder="300" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\TemplateDirective</item>
84-
<item name="legacy" sortOrder="400" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\LegacyDirective</item>
85-
</argument>
86-
</arguments>
87-
</type>
88-
<type name="Magento\Framework\Filter\DirectiveProcessor\Filter\FilterPool">
89-
<arguments>
90-
<argument name="filters" xsi:type="array">
91-
<item name="nl2br" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\Filter\NewlineToBreakFilter</item>
92-
<item name="escape" xsi:type="object">Magento\Framework\Filter\DirectiveProcessor\Filter\EscapeFilter</item>
93-
</argument>
94-
</arguments>
95-
</type>
96-
<type name="Magento\Framework\Console\CommandListInterface">
97-
<arguments>
98-
<argument name="commands" xsi:type="array">
99-
<item name="emailTemplateCheck" xsi:type="object">Magento\Email\Console\Command\DatabaseTemplateCompatibilityCommand</item>
100-
</argument>
101-
</arguments>
102-
</type>
10376
</config>

app/code/Magento/Indexer/etc/di.xml

+1-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
<preference for="Magento\Framework\Indexer\StateInterface" type="Magento\Indexer\Model\Indexer\State" />
1515
<preference for="Magento\Framework\Indexer\IndexMutexInterface" type="Magento\Indexer\Model\IndexMutex" />
1616
<type name="Magento\Framework\Indexer\Table\StrategyInterface" shared="false" />
17-
<type name="Magento\Indexer\Model\Indexer">
18-
<arguments>
19-
<argument name="view" xsi:type="object" shared="false">Magento\Framework\Mview\View</argument>
20-
</arguments>
21-
</type>
2217
<type name="Magento\Indexer\Model\Config">
2318
<arguments>
2419
<argument name="configData" xsi:type="object">Magento\Indexer\Model\Config\Data\Proxy</argument>
@@ -40,8 +35,7 @@
4035
</arguments>
4136
</type>
4237
<type name="Magento\Indexer\Model\Processor">
43-
<plugin name="page-cache-indexer-reindex-clean-cache"
44-
type="Magento\Indexer\Model\Processor\CleanCache" sortOrder="10"/>
38+
<plugin name="page-cache-indexer-reindex-clean-cache" type="Magento\Indexer\Model\Processor\CleanCache" sortOrder="10"/>
4539
</type>
4640
<type name="Magento\Indexer\Model\ProcessManager">
4741
<arguments>
@@ -62,7 +56,6 @@
6256
</argument>
6357
</arguments>
6458
</type>
65-
<preference for="Magento\Framework\Indexer\BatchSizeManagementInterface" type="Magento\Framework\Indexer\BatchSizeManagement" />
6659
<type name="Magento\Indexer\Model\Indexer\DependencyDecorator">
6760
<arguments>
6861
<argument name="indexer" xsi:type="object" shared="false">Magento\Indexer\Model\Indexer</argument>

app/code/Magento/ProductVideo/etc/di.xml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magento\Framework\Api\Data\VideoContentInterface" type="Magento\ProductVideo\Model\Product\Attribute\Media\VideoEntry" />
10+
<!-- ToDo: Preference over Magento\Framework\Validator\ValidatorInterface shouldn't be allowed -->
11+
<!-- ToDo: @see \Magento\ProductVideo\Controller\Adminhtml\Product\Gallery\RetrieveImage -->
1012
<preference for="Magento\Framework\Validator\ValidatorInterface" type="Magento\Framework\Validator\AllowedProtocols" />
1113
<type name="Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool">
1214
<arguments>

app/code/Magento/Ui/etc/di.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<preference for="Magento\Framework\View\Element\UiComponent\ContainerInterface" type="Magento\Ui\Component\Wrapper\UiComponent" />
1010
<preference for="Magento\Framework\View\Element\UiComponent\Control\ActionPoolInterface" type="Magento\Ui\Component\Control\ActionPool" />
1111
<preference for="Magento\Framework\Data\Argument\InterpreterInterface" type="Magento\Framework\Data\Argument\Interpreter\Composite" />
12+
<!-- ToDo: this preference override existing preference in app/etc/di.xml : -->
13+
<!-- <preference for="Magento\Framework\Config\ConverterInterface" type="Magento\Framework\Config\Converter\Dom"/> -->
1214
<preference for="Magento\Framework\Config\ConverterInterface" type="Magento\Framework\View\Element\UiComponent\Config\Converter" />
1315
<preference for="Magento\Framework\View\Element\UiComponent\Config\ManagerInterface" type="Magento\Ui\Model\Manager" />
1416
<preference for="Magento\Framework\View\Element\UiComponent\ContextInterface" type="Magento\Framework\View\Element\UiComponent\Context" />

0 commit comments

Comments
 (0)