Skip to content

@willdurand willdurand released this Jul 29, 2015 · 51 commits to master since this release

UPDATE: Negotiation 2.0.0 has been released on October 1st, 2015.

Hi! It's been a long time, right?

Negotiation is stable for years now, and it works like a charm for most of the common use cases. It has been installed more than two million times. Yes! 2,000,000. That's awesome!

However, we found tricky edge cases we could not fix easily, and our interpretation of the specification has changed over time. That is why I am proud to announce the immediate availability of Negotiation 2.0 (not entirely stable yet).

This new version is a full rewrite, and therefore it is not backward compatible with Negotiation 1.0. However, migrating should not be too complicated as the API has been drastically simplified: there is only one single method to use now (getBest()), and different classes (Negotiator and *Negotiator) for different needs.

Here is the first pre-release (2.0.0-alpha1) of Negotiation 2.0. Please test it, and report feedback, ideas, bugs so that we can work on providing the best content negotiation library written in PHP ever!

Human Readable Changelog

  • Support for wildcard priorities has been removed (#49).
  • Register formats have been removed, as well as the logic to retrieve a format given a media type. Hence, isMediaRange() method has been removed. It has been considered out of scope of the library, and it will avoid missing formats, adding too many mapping formats, etc.
  • Header parsing has been improved both in term of speed, strictness, and design (for instance, it now accepts quoted parameter).
  • Support for partial media ranges has been added.
  • The overall negotiation logic has changed (#45, #48, #51).
  • More named exceptions (#50).
  • And, of course, even more tests!

Scrutinizer Code Quality Code Coverage

All the commits can be found here: 4dd4643...v2.0.0-alpha1 or in #60.

Last but not the least, THANK YOU to @neural-wetware for his huge contribution on this new major version! 💛 💙 ❤️ 💚 🚢 ⭐️ 🌟 💙 🌠 💝

Let's celebrate now!

Assets 2
You can’t perform that action at this time.