Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # What
- 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.
- # Why
- 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.
- # Folder
- 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`
- # How
- The desired folder would contain a composer.json that would look like:
- ```json
- {
- "config": {
- "vendor-dir": "global",
- "bin-dir": "bin"
- }
- }
- ```
- - Using `composer (add|install) package`/`composer (remove|uninstall) package` would modify the `require` 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 directory. There may be a better name for this directory.
Add Comment
Please, Sign In to add comment