Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall / unrequire command for global dependencies #2984

Closed
francoispluchino opened this issue May 12, 2014 · 3 comments
Closed

Uninstall / unrequire command for global dependencies #2984

francoispluchino opened this issue May 12, 2014 · 3 comments

Comments

@francoispluchino
Copy link
Contributor

It would be really interesting to have an command for uninstall a package.

It is true that for a particular project, we can directly edit the composer.json file, but when the library is installed in global mode, we must change the composer.json file in the folder defined by COMPOSER_HOME, which frankly is not easy!

I take an example with PHPUnit:

Since version 4.0, it is recommended to use Composer (in global mode) instead of PEAR. Ok, It's cool, we use our favorite tool of dependency management, and we follow the documentation for the install:

$ composer.phar global require "phpunit/phpunit=4.0.*"

Except that now, a new update is available, the 4.1. A simple update does not pass to the higher release, and change the version number in command line is not possible:

$ composer.phar global require "phpunit/phpunit=4.1.*"

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: phpunit/phpunit-mock-objects[2.1.0, 2.0.5].
    - Can only install one of: phpunit/phpunit-mock-objects[2.1.0, 2.0.5].
    - phpunit/phpunit 4.1.0 requires phpunit/phpunit-mock-objects ~2.1 -> satisfiable by phpunit/phpunit-mock-objects[2.1.0].
    - Installation request for phpunit/phpunit 4.1.* -> satisfiable by phpunit/phpunit[4.1.0].
    - Installation request for phpunit/phpunit-mock-objects == 2.0.5.0 -> satisfiable by phpunit/phpunit-mock-objects[2.0.5].

It is therefore necessary to manually change the global composer.json file, which is not easy.

The problem also arises when one wants to test or temporarily use a library in global mode: impossible to easily uninstall by command line.

Is it possible to add this command? I think that would be very useful since Composer can install libraries in global mode.

@stof
Copy link
Contributor

stof commented May 12, 2014

duplicate of #1622 (once composer unrequire will be implemented, it will be available in global mode as well automatically)

@francoispluchino
Copy link
Contributor Author

@stof Sorry, yet I checked before creating this issue.

@sanmai
Copy link
Contributor

sanmai commented Jun 24, 2016

For anyone coming here from Google, there is composer global remove now available.

E.g.:

composer global remove fabpot/php-cs-fixer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants