I\'m beginning using composer, I know so little about it and have a little experience with web application development.
I just walk through Nettuts+ Tutorial, so I h
Typically, software will run in different environments:
developmenttestingstagingproductionThe dependencies which are declared in the require section of composer.json are typically dependencies which are required for running an application or a package in
stagingproductionenvironments, whereas the dependencies declared in the require-dev section are typically dependencies which are required in
developingtestingenvironments.
For example, in addition to the packages used for actually running an application, packages might be needed for developing the software, such as:
friendsofphp/php-cs-fixer (to detect and fix coding style issues)squizlabs/php_codesniffer (to detect and fix coding style issues)phpunit/phpunit (to drive the development using tests)Now, in development and testing environments, you would typically run
$ composer install
to install both production and development dependencies.
However, in staging and production environments, you only want to install dependencies which are required for running the application, and as part of the deployment process, you would typically run
$ composer install --no-dev
to install only production dependencies.
In other words, the sections
requirerequire-devindicate to composer which packages should be installed when you run
$ composer install
or
$ composer install --no-dev
That is all.
Note Development dependencies of packages your application or package depend on will never be installed
For reference, see: