
Composer
Authors: Nils Adermann, Jordi Boggiano and many community contributions Sponsored by: Logo by: Max Grigorian Composer and all content on this site are released under the MIT license.
Composer
2012年3月1日 · To quickly install Composer in the current directory, run the following script in your terminal. To automate the installation, use the guide on installing Composer …
Introduction - Composer
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Basic usage - Composer
To start using Composer in your project, all you need is a composer.json file. This file describes the dependencies of your project and may contain other metadata as well.
Command-line interface / Commands - Composer
To get help from the command-line, call composer or composer list to see the complete list of commands, then --help combined with any of those can give you more information.
Composer
Versions and constraints Versions explained. FAQs How do I install a package to a custom path for my framework? How do I install Composer programmatically? How do I install untrusted packages safely? Is it safe to run Composer as superuser or root? How to use Composer behind a proxy Should I commit the dependencies in my vendor directory?
Repositories - Composer
Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer.
Libraries - Composer
Packagist is the main package repository for Composer, and it is enabled by default. Anything that is published on Packagist is available automatically through Composer.
Config - Composer
As of Composer 2.2.0, the allow-plugins option adds a layer of security allowing you to restrict which Composer plugins are able to execute code during a Composer run.
Composer
* * @return string */ function getUserDir() { $userEnv = defined('PHP_WINDOWS_VERSION_MAJOR') ? 'APPDATA' : 'HOME'; $userDir = getenv($userEnv); if (!$userDir) { throw new RuntimeException('The '.$userEnv.' or COMPOSER_HOME environment variable must be set for composer to run correctly'); }