2

With Magento 2.3, console command found which helps developers to find all the classes related to dependency injection.

It seems that it shows dependency Injection classes from di.xml from all areas.

Ques: Does anyone know whether it shows which modules do have a dependency on which modules?

1
  • 1
    It does give plugins info (i.e) bin/magento dev:di:info Magento\\Catalog\\Model\\Product, but DI preference no luck Commented Feb 21, 2020 at 8:01

2 Answers 2

2

you can Use the dev:di:info command to retrieve information about dependency injection configuration for a class. Like if you want to retrieve information for class Magento\Catalog\Model\Product then run the command bin/magento dev:di:info "Magento\Catalog\Model\Product" from your command line. you'll get output something like this. enter image description here

you can get info of your custom class or any vendor class.

1
  • 1
    An another example would be bin/magento dev:di:info "Magento\Search\Model\Adminhtml\System\Config\Source\Engine". The command lists the versions of Elasticsearch in the column "configured values" Commented Jan 15, 2022 at 14:06
2

Ques : What is the use of php bin/magento dev:di:info command?

Answer :

bin/magento dev:di:info "<class-namespace>"

This Command Will Generate the List of the preferences and plugins (after, around and before) which is used for the particular class.

Official Reference : Magento Devdocs - Info Di List enter image description here

Ques : Does anyone know whether it shows which modules do have a dependency on which modules?

Answer :

For this you can use the command :

bin/magento info:dependencies:show-modules 

It will generate the csv file at magento root (modules-dependencies.csv), If the path is not specified in the command.

You can learn, more about this command in the Official Document : Magento Devdocs - Info Dependencies enter image description here

So from the above two commands, You can catch the particular Module or Class for development purpose or for debugging.

Happy Coding !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.