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).

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
itnelo
  • 1,053
  • 2
  • 18
  • 29
  • Have you tried it? Can't you use `"2.0.6 | dev-master"`? – A.L Feb 24 '16 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 Feb 24 '16 at 21:42
  • According to [this answer](http://stackoverflow.com/a/21316829/2257664), the version with hash is correct. The error message may be due to the fact that the hash does not exist in `dev master`. – A.L Feb 25 '16 at 00:29

1 Answers1

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
A.L
  • 10,259
  • 10
  • 67
  • 98
  • thank you for help, i think this situation is a special case of yet another dependency conflict in software – itnelo Feb 25 '16 at 08:03
  • @itnelo did you install globally `fxp/composer-asset-plugin:~1.1.1`? Are composer and this package up-to-date? – A.L Feb 25 '16 at 08:27
  • 1
    I can't properly work and test this right now due to this bug in composer asset plugin: https://github.com/francoispluchino/composer-asset-plugin/issues/191 it maybe related error and i prefer to wait until this will be fixed – itnelo Feb 25 '16 at 08: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 Feb 25 '16 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](http://stackoverflow.com/q/12896780/2257664). – A.L Feb 25 '16 at 10:59