Php fusion
Publié le - 1490 v. -

All you need to know about composer

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.

Using Composer

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 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.


Les publications similaires de "Actu PHP"

  1. 11 Août 2021The Importance of a PHP Developer: Understand Your Needs73 v.
  2. 3 Juil. 2021Look at the new publishing media !84 v.
  3. 23 Avril 2021Is ruby for you?131 v.
  4. 13 Fév. 2021Suggest a good php service is also improved the SEO of a website196 v.
  5. 21 Déc. 2020Working with the most competent Php firms261 v.
  6. 10 Déc. 2020Building a bridge inbetween SEO and Php programming303 v.
  7. 3 Déc. 2020What php means293 v.
  8. 4 Nov. 2020All the services provided by a Php company285 v.
  9. 4 Oct. 2020Hire the leading Php Company out there271 v.
  10. 4 Août 2020Just the Php company you need367 v.
  11. 12 Mai 2020What is the difference inbetween a Php developer and a Magneto developer ?398 v.
  12. 3 Avril 2020The latest about php!467 v.
  13. 4 Mars 2020How can you insert a basket for an ecommerce ?488 v.