willdurand/negotiation
Content Negotiation tools for PHP provided as a standalone library.
3.1.0
133M downloads/mo
#448 most downloaded on Packagist
willdurand/Negotiation
What this package is like to depend on
Last release 5 years ago
no release in 18 months
Ships unpredictably
gaps range from 1 weeks to 3.4 years
Rarely documented
notes for 7 of 41 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
45 releases · first in 2013
0 releases in the last 12 months
see the full history below
Release timeline
45 releases · Jan 2013 to Jan 2022Releases
latest 45-
3.1.030 Jan 2022Release notes
Open source →This new release should be fully compatible with PHP 8.1.
What's Changed
- Added: add missed fallback to generic language (in
LanguageNegotiator) by @rtm-ctrlz in #113 - Fixed: invalid PHPDocs return comment by @michalbundyra in #112
- Fixed: incompatibilities with some null values for PHP 8.1 by @W0rma in #114
- Fixed: switch from travis to github actions by @willdurand in #116
New Contributors
- @michalbundyra made their first contribution in #112
- @rtm-ctrlz made their first contribution in #113
- @W0rma made their first contribution in #114
Full Changelog:
See 3.0.0...3.1.0
- Added: add missed fallback to generic language (in
-
3.0.025 Sep 2020Release notes
Open source →👋 Hi! It's been a long time.
This new major version is very similar to the
2.xversion. In fact, the only main benefit is to support PHP 8, which required some changes that might be considered backward incompatible (see #106).Upgrade should be safe and it's recommended. This library has been very stable over the years so we didn't change a lot of things between the versions 2 and 3. Have fun!
-
3.0.0-alpha314 May 2017 pre-releaseRelease notes
Open source → -
3.0.0-alpha204 May 2017 pre-release -
3.0.0-alpha104 Mar 2017 pre-releaseRelease notes
Open source →This is the very first
alpharelease of the next major version of this library. This version works almost like the current major version (v2) but fixes a sort of regression for some users that could not be merged into the v2 (cf. version 2.2.1).💬 Everyone is encouraged to migrate to the v3.
- Added: Implement
getOrderedElements()(cf. #90) - Added: a third optional (boolean) parameter is now available in the
getBest($header, array $priorities, $strict = false)method. This parameter allows to throw exceptions if theAcceptheader is incorrect (default behavior is to silently ignore this case, cf. release 2.0.3).
- Added: Implement
-
v2.3.114 May 2017Release notes
Open source → -
v2.3.004 May 2017 -
v2.2.114 Oct 2016Release notes
Open source →I revert the code introduced in version 2.2.0 about 2 hours after having released it because the code changed the public API, and therefore introduced a BC break. This version fixes the issue and I am going to publish a new major version for the code previously introduced in 2.2.0.
Please use this version and not 2.2.0
-
v2.2.014 Oct 2016Release notes
Open source →⚠️ PLEASE DO NOT USE THIS VERSION, USE 2.2.1 INSTEAD. SORRY 😕
Added: a third optional (boolean) parameter is now available in the
getBest($header, array $priorities, $strict = false)method. This parameter allows to throw exceptions if theAcceptheader is incorrect (default behavior is to silently ignore this case, cf. release 2.0.3).⚠️ PLEASE DO NOT USE THIS VERSION, USE 2.2.1 INSTEAD. SORRY 😕
-
v2.1.021 Sep 2016 -
v2.0.330 Aug 2016Nothing published for this version
-
v2.0.221 Nov 2015Nothing published for this version
-
v2.0.102 Oct 2015Nothing published for this version
-
v2.0.003 Sep 2015Nothing published for this version
-
v2.0.0-alpha129 Jul 2015 pre-releaseRelease notes
Open source →d26d6b0
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!
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!
-
-
1.5.001 Oct 2015Nothing published for this version
-
1.4.028 Jul 2015Nothing published for this version
-
1.3.402 Oct 2014Nothing published for this version
-
1.3.316 May 2014Nothing published for this version
-
1.3.226 Feb 2014Nothing published for this version
-
1.3.106 Feb 2014Nothing published for this version
-
1.3.020 Jan 2014Nothing published for this version
-
1.2.502 Oct 2014Nothing published for this version
-
1.2.416 May 2014Nothing published for this version
-
1.2.328 Feb 2014Nothing published for this version
-
1.2.211 Feb 2014Nothing published for this version
-
1.2.109 Jan 2014Nothing published for this version
-
1.2.014 Dec 2013Nothing published for this version
-
1.1.216 May 2014Nothing published for this version
-
1.1.111 Feb 2014Nothing published for this version
-
1.1.006 Dec 2013Nothing published for this version
-
1.0.516 May 2014Nothing published for this version
-
1.0.406 Feb 2014Nothing published for this version
-
1.0.326 Nov 2013Nothing published for this version
-
1.0.221 Nov 2013Nothing published for this version
-
1.0.101 Aug 2013Nothing published for this version
-
1.0.027 Jul 2013Nothing published for this version
-
0.0.826 Jul 2013Nothing published for this version
-
0.0.726 Jul 2013Nothing published for this version
-
0.0.626 Jul 2013Nothing published for this version
-
0.0.526 Jul 2013Nothing published for this version
-
0.0.419 Jul 2013Nothing published for this version
-
0.0.319 Jul 2013Nothing published for this version
-
0.0.220 Jan 2013Nothing published for this version
-
0.0.120 Jan 2013Nothing published for this version