1.3.3: Composer JSON Directives

composer.json directives

composer.json

require: specifies which modules should be included. This is a great overview of versions and their constraints.

require-dev: this is used when composer install --dev is specified. This is often used in your development environment to also include tooling like PHPUnit.

autoload:

  • files: These are loaded on every request. Magento uses this to initialize module loading in app/etc/NonComposerComponentRegistration.php.
  • psr-4: This is the most common autoload initialization clause. This associates a namespace with a path. For example, this file declares that Bold\OrderComment is associated with the base directory, found in vendor/boldcommerce/magento2-ordercomments. All classes inside this directory are located as they started Bold\OrderComment\....

Further reading:

Complete and Continue