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


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

Anybody can explain it to me?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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