League Uri decoupled

Attention: Les informations de ce billet sont susceptibles d'être obsolètes car vieux de plus 2 ans.

Warning: The information you are reading may be obsolete, this post was published more than 2 years ago.

Last month the release of League\Uri version 5 was announced using a simple tweet.

https://twitter.com/nyamsprod/status/828530046172332032

While I pointed out in the tweet that this new release is PHP7 only, the main selling point of this new version is the package conversion into a meta-package. So instead of one single release, last month 5 packages were in fact released.

By splitting the main package into smaller packages the end user can now select the packages he/she really more easily. For instance, if you already are using a PSR-7 UriInterface compliant object, you only need to require the league\uri-manipulations to perform the following operation.

As a side note, this change also enables easier maintenance as bugs can be more quickly fix in each separate package.

Of course, a new major release means improvements and backward incompatible changes in the public API. For instance, a new Query::getParams method is introduced to improve query string deserialization made by PHP’s parse_str. This method:

If you are still using League\Uri 4.x do not worry. The package remains supported for 6 more months through patches and security fixes. But new features will only land on the respective new packages.

Because trying to summarize 5 packages into a single blog would be overkill I’d suggest you head over the new documentation website for more informations.

Final note

The League Uri is an open source project with a MIT License so contributions are more than welcome and will be fully credited. These contributions can be anything from reporting an issue, requesting or adding missing features or simply improving or correcting some typo on the documentation website.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.