Skip to main content

Glossary C

Glossary · E-commerce

Composer

Area
E-commerce

Composer is a tool for dependency management in PHP: a project declares the libraries it depends on, and Composer installs and updates them.

All a project needs to get started with Composer is a file called composer.json. According to the Composer documentation on basic usage, the file describes the project's dependencies and can hold other metadata as well. Composer works project by project. It installs packages into a directory inside the project, such as vendor, and by default installs nothing globally.

The same file can also state which versions of server software a project requires. Composer handles this through platform packages, which represent software installed on the server, such as PHP itself and its extensions. The exact package versions installed are recorded elsewhere, in the lock file. The command composer audit compares the installed packages with security advisories.

In our Shopware 5 work, the composer.json that ships with the shop system tells us which PHP versions a shop allows. Our standard approach is to leave that file as it is. The dependencies we update go into our own Composer manifest instead: a second file, kept apart from the shipped one. We run composer audit on those updated dependencies as well.

Where the term appears

Sources

  1. Composer Documentation: Introduction (opens in a new tab)

    Composer (getcomposer.org) accessed

  2. Composer Documentation: Basic usage (opens in a new tab)

    Composer (getcomposer.org) accessed

Share on LinkedIn

Let's talk about your project.

If this term is on your desk right now, a conversation usually helps faster than any definition.

Search the website

Popular topics

All results