This is a proposed feature for Composer in which you would be able to add a --global
option to manipulate installed packages at a system-wide / user-wide level.
This should not be used for autoloading, but rather just for running any binaries.
Some projects provide utilities to be run via the command line. Like other package managers, these packages should be able to be installed at a global level so the commands can be run as long as you have the bin directory in your PATH.
Since Composer already uses ~/.composer
for caching, this should be the default folder for --global. There needs to be a way to specify an alternative location i.e. /usr/local/lib/composer
The desired folder would contain a composer.json that would look like:
{
"config": {
"vendor-dir": "vendor",
"bin-dir": "bin"
}
}
- Using
composer (add|install) package
/composer (remove|uninstall) package
would modify therequire
hash of this file and then perform the appropriate action. - Users could optionally specify a version when installing:
--version
option or@version
suffix - Packages would be installed under the global vendor directory.