Guest User

Untitled

a guest
Oct 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. # What
  2.  
  3. 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.
  4.  
  5. This should not be used for autoloading, but rather just for running any binaries.
  6.  
  7. # Why
  8.  
  9. 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.
  10.  
  11. # Folder
  12.  
  13. 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`
  14.  
  15. # How
  16.  
  17. The desired folder would contain a composer.json that would look like:
  18.  
  19. ```json
  20. {
  21. "config": {
  22. "vendor-dir": "global",
  23. "bin-dir": "bin"
  24. }
  25. }
  26. ```
  27.  
  28. - Using `composer (add|install) package`/`composer (remove|uninstall) package` would modify the `require` hash of this file and then perform the appropriate action.
  29. - Users could optionally specify a version when installing: `--version` option or `@version` suffix
  30. - 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