Composer Dependency Manager
suggest changeIntroduction
Composer is PHP’s most commonly used dependency manager. It’s analogous to npm in Node, pip for Python, or NuGet for .NET.
Syntax
- php path/to/composer.phar [command] [options] [arguments]
Parameters
| Parameter | Details |
|---|---|
| license | License identifier for the package. |
| authors | Authors and their contact details. |
| support | Support email, IRC channel, and related links. |
| require | Runtime dependencies and version constraints. |
| require-dev | Dependencies needed only to develop the project. |
| suggest | Optional packages that are useful but not required. |
| autoload | Autoload rules for the project. |
| autoload-dev | Autoload rules used only in development. |
Remarks
Autoloading will only work for libraries that specify autoload information. Most libraries do and will adhere to a standard such as PSR-0 or PSR-4.
Helpful Links
- Packagist – Browse available packages (which you can install with Composer).
- Official Documentation
- Official Getting Started guide
Few Suggestions
- Disable xdebug when running Composer.
- Do not run Composer as
root. Packages are not to be trusted.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents