Composer is a dependency management system for PHP programming projects. It provides standardized formats for managing PHP libraries. Composer was developed by Jordi Boggiano and Nils Adermann in 2012, who still lead the project.
Composer is installed directly on the server via the console or command line, allowing the user to install PHP applications that are available in its dependencies. The Composer repository contains the available packages, where you can download and keep updated the software packages on which your project is based. Today, it is widely used by national and international companies for library management, as is the case with Transbank\'s Webpay Plus, whose latest REST API version is based on Composer.
The goal of Composer is to facilitate the start of a project and allow you to perform required tasks more quickly by installing and maintaining libraries.
Why use Composer? The classic developer maxim is not to reinvent the wheel, and it\'s true that nowadays, most websites contain common libraries, such as those for sending emails, form validation, and even design elements like Bootstrap. Even if you work natively, the use of APIs is vital in systems development today.
Therefore, when using a third-party library, which in turn depends on other packages or library downloads, Composer will automatically pre-install it, leaving you with the sole task of library maintenance and updates.Basic Composer Commands and Functionality
The following describes basic Composer commands.`require: adds the library parameter to the composer.json file and installs it.
install: installs all the libraries in composer.json. This is the command used to download all PHP dependencies from the repository.update
: Updates the libraries incomposer.json` according to the allowed versions specified.
remove: Uninstalls a library and removes it from
composer.json. ` Composer\'s functionality is basically managed through a file called
composer.json, which is installed in the root folder of your project. This file has a JSON structure that allows you to manage and view the dependencies used in your project. When you install a package, a folder called
/vendor/is created, which contains folders with the libraries and basic dependencies for your web project to function. I\'m limiting myself to a basic description of how it works, without providing examples.
Comments
0Be the first to comment