September 2017
Intermediate to advanced
244 pages
6h 44m
English
Instead of using composer require, we can also install a package through another command if we have a composer.json file. To do so, go into another directory. We can simply make a composer.json file having a list of packages with the following content:
{ "require": { "phpunit/phpunit": "^6.2", "phpspec/phpspec": "^3.2" }}
So, once you have a file named composer.json and have this content in it, you can simply install these two packages with their dependencies based on this version information by running this command:
composer install
This will do the same thing that Composer require did. However, if both composer.json and composer.lock files are present, it will read information from the composer.lock file and ...
Read now
Unlock full access