Dependency management
Dependency management is a methodology that allows you to declare the libraries required for your project and makes it easier to install or update them. The most well-known tool for PHP is called Composer. In previous chapters, we gave a little overview about this tool.
For our project, we will need to use a single Composer setup for each microservice. When we installed Lumen, Composer did the work for us and created the configuration file, but now we will explain how it works in detail.
Once we have Docker installed and we are in the PHP-FPM container we want to work on, it is necessary to generate the composer.json
file. This a configuration file for Composer where we define our project and all the dependencies:
{ "name": "php-microservices/user", "description": "Finding Secrets, User microservice", "keywords": ["finding secrets"...