Magento 2 - I would like to understand the mechanism of running the “setup:di:compile” command

magento.stackexchange https://magento.stackexchange.com/questions/112390

  •  29-09-2020
  •  | 
  •  

Question

I would like to understand the mechanism of running the setup:di:compile command in Magento 2.

Example:

  • Step 1: it is checking...
  • Step 2: it is generating...
  • ...

Anybody can explain it to me?

Was it helpful?

Solution

Overview of code compilation

Code compilation consists of all of the following in no particular order:

  • Application code generation (factories, proxies, and so on)
  • Area configuration aggregation (that is, optimized dependency injection configurations per area)
  • Interceptor generation (that is, optimized code generation of interceptors)
  • Interception cache generation
  • Repositories code generation (that is, generated code for APIs)
  • Service data attributes generation (that is, generated extension classes for data objects)

You can find code compilation in classes in the \Magento\Setup\Module\Di\App\Task\Operation namespace.

For more information: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-compiler.html

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top