Composer is a utility which is mainly used for managing package of a project or application based on PHP programming language. Based on the definition described in Wikipedia, Composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. Further information describing about Composer, still in the Wikipedia site, Composer was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project. They began development in April 2011 and first released it on March 1, 2012. Composer is strongly inspired by Node.js’s “npm” and Ruby’s “bundler“. The project’s dependency solving algorithm started out as a PHP-based port of openSUSE’s libzypp satsolver.
In this context, composer is used for an example as a package management of an application based on PHP Programming Language such as Laravel. In Linux operating system, especially if it is in a CLI (Command Line Interface)-based, composer can be executed via command line.
So, based on the information still covered in Wikipedia, it is stated that Composer runs through the command line and installs dependencies (e.g. libraries) for an application. It also allows users to install PHP applications that are available on “Packagist” which is its main repository containing available packages. It also provides autoload capabilities for libraries that specify autoload information to ease usage of third-party code.
Basically, when it is needed for another package to be added or installed in our application which is made using PHP programming language such as Laravel for the framework, Composer can be used for this purpose. Since, Composer itself is used as an integral part of almost every popular open-source PHP project besides Laravel.
To use composer, there is a need for an internet connection so that the request for adding, modifying or installing package can be achieved. But the important thing to do before start using it is checking the internet connection whether composer can be used properly or not.
To check the composer’s HTTP connection, below is the command which can be executed in a command line interface :
Normally, if there is nothing to be worried about the HTTP Connection, below is the output of the executed command :
user@hostname:~$ composer diag Checking composer.json: OK Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: OK Checking disk free space: OK Checking pubkeys: Tags Public Key Fingerprint: XXXXXXX XXXXXX XXXXXX XXXXXXXX XXXXXXX XXXXXX XXXXXXX XXXXXX Dev Public Key Fingerprint: XXXXXXX XXXXXXXX XXXXXXXXXX XXXXXX XXXXXXX XXXXXXX XXXXX XXXXXX OK user@hostname:~$
Based on the output above, there is no problem with the HTTP Connection and furthermore it can be used to install, modify package in the application developed based on PHP programming language.