{"id":2660,"date":"2017-03-10T14:56:11","date_gmt":"2017-03-10T12:56:11","guid":{"rendered":"http:\/\/nyamsprod.com\/blog\/?p=2660"},"modified":"2017-03-10T14:56:11","modified_gmt":"2017-03-10T12:56:11","slug":"league-uri-decoupled","status":"publish","type":"post","link":"https:\/\/nyamsprod.com\/blog\/league-uri-decoupled\/","title":{"rendered":"League Uri decoupled"},"content":{"rendered":"<div class=\"message warning\">\n<p><strong>Attention:<\/strong> Les informations de ce billet sont susceptibles d'&ecirc;tre obsol&egrave;tes car vieux de plus 2 ans.<\/p>\n<p><strong>Warning: <\/strong> The information you are reading may be obsolete, this post was published more than 2 years ago.<\/p>\n<\/div><p>Last month the release of League\\Uri version 5 was announced using a simple tweet.<\/p>\n<p>https:\/\/twitter.com\/nyamsprod\/status\/828530046172332032<\/p>\n<p>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.<!--more--> So instead of one single release, last month 5 packages were in fact released.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/thephpleague\/uri-interfaces\" target=\"_blank\">League\\Uri-Interface<\/a> a basic Uri Interface<\/li>\n<li><a href=\"https:\/\/github.com\/thephpleague\/uri-parser\" target=\"_blank\">League\\Uri-Parser<\/a> a RFC3986\/RFC3987 URI parser<\/li>\n<li><a href=\"https:\/\/github.com\/thephpleague\/uri-components\" target=\"_blank\">League\\Uri-Components<\/a> the URI components package<\/li>\n<li><a href=\"https:\/\/github.com\/thephpleague\/uri-schemes\" target=\"_blank\">League\\Uri-Schemes<\/a> which validate and normalize any URI according to its scheme specificity<\/li>\n<li><a href=\"https:\/\/github.com\/thephpleague\/uri-manipulations\" target=\"_blank\">League\\Uri-Manipulations<\/a> which manipulate URIs through a formatter and a collection of URI middlewares<\/li>\n<\/ul>\n<p>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 <code>UriInterface<\/code> compliant object, you only need to require the <code>league\\uri-manipulations<\/code> to perform the following operation.<\/p>\n<script src=\"https:\/\/gist.github.com\/48814c42143a27b9b9491c3c76fa74cb.js?file=uri-middleware.php\"><\/script>\n<p>As a side note, this change also enables easier maintenance as bugs can be more quickly fix in each separate package.<\/p>\n<p>Of course, a new major release means <a href=\"http:\/\/uri.thephpleague.com\/5.0\/\" target=\"_blank\">improvements <\/a>and <a href=\"http:\/\/uri.thephpleague.com\/upgrading\/5.0\/\" target=\"_blank\">backward incompatible changes<\/a> in the public API. For instance, a new <code>Query::getParams<\/code> method is introduced to improve query string deserialization made by PHP&#8217;s <code>parse_str<\/code>. This method:<\/p>\n<ul>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/on_demand_name_mangling\" target=\"_blank\">will not mangle the returned data<\/a>;<\/li>\n<li><a href=\"http:\/\/grokbase.com\/t\/php\/php-internals\/123epc6d2m\/let-parse-str-parse-more-than-max-input-vars-args\" target=\"_blank\">is not bound by PHP ini settings<\/a>;<\/li>\n<li><a href=\"https:\/\/bugs.php.net\/bug.php?id=52343\" target=\"_blank\">allows better control over the serialization<\/a>;<\/li>\n<\/ul>\n<script src=\"https:\/\/gist.github.com\/48814c42143a27b9b9491c3c76fa74cb.js?file=query-getparams.php\"><\/script>\n<p>If you are still using <code>League\\Uri 4.x<\/code> 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.<\/p>\n<p>Because trying to summarize 5 packages into a single blog would be overkill I&#8217;d suggest you head over the new <a href=\"http:\/\/uri.thephpleague.com\" target=\"_blank\">documentation website<\/a> for more informations.<\/p>\n<h3>Final note<\/h3>\n<p>The<a href=\"https:\/\/github.com\/thephpleague\/uri\" target=\"_blank\"> League Uri<\/a> 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>League URI 5 has been released and is now decoupled #thephpleague #uri #php<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[812,813,409,808,785,794],"class_list":["post-2660","post","type-post","status-publish","format-standard","hentry","category-web","tag-decoupled","tag-middlewares","tag-parse_str","tag-parse_url","tag-thephpleague","tag-uri"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":5,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"predecessor-version":[{"id":2666,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2660\/revisions\/2666"}],"wp:attachment":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}