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.
- League\Uri-Interface a basic Uri Interface
- League\Uri-Parser a RFC3986/RFC3987 URI parser
- League\Uri-Components the URI components package
- League\Uri-Schemes which validate and normalize any URI according to its scheme specificity
- League\Uri-Manipulations which manipulate URIs through a formatter and a collection of URI middlewares
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:
- will not mangle the returned data;
- is not bound by PHP ini settings;
- allows better control over the serialization;
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.