Categories
PHP Web Development

PHP Dependency Management Tool – Composer and Packagist

Composer is an application-level PHP dependency management tool. It will seamlessly install and update the packages that you declare as your PHP project’s dependencies. Composer pulls the latest packages from the PHP package repository, Packagist. However, it is not a package manager. 

Nils Adermann and Jordi Boggiano have developed the tool and first released it in March 2012. Composer manages the packages within a specific directory by default, not globally. It does have a global command and support for the global project as well. In general, the composer handles package dependencies per-project basis. The idea behind Composer is based on the node‘s npm concept.

What is a library or a package?

As a PHP programmer, you must know that everyone searches on the internet for a readily available class file to achieve certain functionality. So, that way we don’t have to code some functionality on our own. Therefore, we could save some time.

Remember the early age techniques of including a third party class file in your PHP project for handling different requirements like the file upload or to export a data grid into an excel file format or send an email using third party SMTP! Things are not that simple anymore. Now you have to handle User Authentication with social media login support, Request Routing with custom routing pattern matching, File Uploading with extension restriction and remote storage support, etc. It is good that the functionalities are still readily available on the internet, however, the fact is, the single class files have now become packages including multiple class files and directories.