2

I need to use a bugfix which has not been released yet. Can I use something like:

"bower-asset/yii2-pjax": "2.0.6 | dev-master#18a9183d578d81fb9dbb1c604daba48815c3ebd5 as 2.0.5"

or

"bower-asset/yii2-pjax": "2.0.6 | dev-master as 2.0.5"

in my composer.json? Where 2.0.6 is the stable version in future and dev-master#hash is the commit including the bugfix, now available in remote repo (@master).

3
  • Have you tried it? Can't you use "2.0.6 | dev-master"? Commented Feb 24, 2016 at 21:40
  • Yes, but got error "package could not be found in any version". If I am moving in the right direction, how can i configure logic like this in composer.json?
    – itnelo
    Commented Feb 24, 2016 at 21:42
  • According to this answer, the version with hash is correct. The error message may be due to the fact that the hash does not exist in dev master. Commented Feb 25, 2016 at 0:29

1 Answer 1

1

While trying to install this package, I discovered that it has a dependency (thanks to lichunqiang).

Here is how to install the dependency and the package:

composer require "fxp/composer-asset-plugin:~1.1.1"
composer require "bower-asset/yii2-pjax:dev-master"

For some reason, composer require "bower-asset/yii2-pjax:2.0.6" does not work, it seems that composer-asset-plugin, the Composer plugin which is used to install the Bower asset does not find any corresponding version.


The current version of Composer is broken, it returns this error:

[ErrorException]
Illegal offset type in isset or empty

You can get back to the old version by rolling back:

composer self-update --rollback
5
  • thank you for help, i think this situation is a special case of yet another dependency conflict in software
    – itnelo
    Commented Feb 25, 2016 at 8:03
  • @itnelo did you install globally fxp/composer-asset-plugin:~1.1.1? Are composer and this package up-to-date? Commented Feb 25, 2016 at 8:27
  • 1
    I can't properly work and test this right now due to this bug in composer asset plugin: github.com/francoispluchino/composer-asset-plugin/issues/191 it maybe related error and i prefer to wait until this will be fixed
    – itnelo
    Commented Feb 25, 2016 at 8:48
  • already did rollback, thanks for tip. I'am ok with "bower-asset/yii2-pjax": "dev-master#18a9183d578d81fb9dbb1c604daba48815c3ebd5 as 2.0.5" right now. Was interested in solution in which I can achieve auto update to stable branch if it's become available (without manual edit composer.json)
    – itnelo
    Commented Feb 25, 2016 at 10:45
  • 1
    I don't know if it's possible, but I think it's a bad idea, you can't be sure that the 2.0.6 will be published or will work perfectly. You should better manage your composer.lock through your Version Control System. Commented Feb 25, 2016 at 10:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.