Composer is a free package manager written in PHP. That is, a tool that automates the procedures for installing, uninstalling, and updating software within a computer system. Composer allows its users to declare and install the libraries for which the main project needs
The project is now available on the GitHub platform, web hosting and software development management service, using the Git VCS.
The installation of Composer is very simple, you must have the php command available in the terminal.
Composer uses a composer.json file that contains several information about the project, including a list of the libraries used. It is then able to automatically download these libraries (and associated dependencies) and generate an autoloader to use them simply in your PHP projects. This file will list all the files to download and will have to be at the root of your project. The file composer.json allows you to specify the different dependencies.
In the require section you will be able to put the packages you want to use for your project.
The list of all packages is available on packagist.org. Once the list of dependencies specified you just have to install them with a: "composer.phar install".
This will create (or update) the vendor file that will contain your library. The advantage is that Composer is able to handle dependencies, so if your library needs another library to run it will be automatically downloaded.
And in my PHP
So it's nice to download libraries, but still have to be able to include them. During an install or update Composer will automatically generate an autoloader autoload.php available at the root of the vendor folder.
This autoloader does not have to include the files of the different libraries, but uses a system of autoloader.
To know more about Composer, connect with our php developers. Composer is adopted by the majority of the PHP community (CakePHP, Laravel, Symfony ... all use it) and will allow you to manage simply the dependencies of your projects.