Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Composer installed a fork instead if this bundle #177
Hello, I'm not sure this is a JMSTranslationBundle or a Composer bug but something strange happened.
I just wanted to install version 1.0 of JMSTranslationBundle but latest version of a fork of it was installed instead.
Here what happened
simone@mypc:/var/www/myprj$ composer require jms/translation-bundle Please provide a version constraint for the jms/translation-bundle requirement: 1.0 ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing nikic/php-parser (v0.9.2) Downloading: 100% - Installing znanylekarz/translation-bundle (dev-master ec65665) Cloning ec656651d16a02585229827fce13b75c6b7aef4a Writing lock file Generating autoload files [..]
So, my question is: Is it normal that I got this bundle https://github.com/ZnanyLekarz/JMSTranslationBundle installed instead of JMSTranslationBundle ?
It's not ok no, but it's related to composer/composer#2690
Anyway I deleted the offending fork, @mlebkowski @nediam please take notice and use https://getcomposer.org/doc/05-repositories.md#vcs instead of abusing packagist to fork packages. If it's a real fork you intend to maintain you can submit it to packagist but then you should not use
@mlebkowski sorry if it caused you problems, but we have to be fairly reactive with those packages otherwise it can cause problems for many more people. Anyway using provide is going to cause the same problem I'm afraid. http://blog.naderman.de/2014/02/17/replace-conflict-forks-explained/ explains some more. Basically using replace/provide on packagist is not really allowed unless you are really replacing a package 1:1. Valid examples are symfony or zend framework that have big all-in-one packages replacing the individual packages for every component. For forks, you can not say you replace or provide it, since it is effectively not the same code. In the future if we manage to improve on that situation though it should be possible to use replace on public packages without interfering with other users that did not explicitly require your fork, so hopefully this will resolve your use case.