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 | Defines the type of license you want to use in the Project. | authors | Defines the authors of the project, as well as the author details. | support | Defines the support emails, irc channel, and various links. | require | Defines the actual dependencies as well as the package versions. | require-dev | Defines the packages necessary for developing the project. | suggest | Defines the package suggestions, i.e. packages which can help if installed. | autoload | Defines the autoloading policies of the project. | autoload-dev | Defines the autoloading policies for developing the project. |
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.