All Notable changes to League\Uri will be documented in this file
Next - TBD
Uri::parsereturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::fromBaseUriandUri::new) that mimics the behaviour of the upcoming native PHP URI parse method.Uri::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::new).Http::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofHttp::new).Http::whenconditional method to ease component building logic.Uri::whenconditional method to ease component building logic.Uriimplements the newLeague\Uri\Contract\UriInspectorinterfaceUriimplements the newLeague\Uri\Contract\UriRendererinterfaceUri::fromMarkdownAnchorUri::fromHtmlAnchorUriTemplateimplements theStringableinterfaceUri::resolvereturns a newUriinstance resolve against the current instance.Uri::normalizereturns a newUriinstance with a full “normalized-decoded” representation: The URI is normalized (when applicable), and components are percent-decoded. Normalization may contain destructive operation.UriandHttpclasses implement a serialize mechanism to safely serialize and unserialize the instance- Dependency to
psr/http-factorypackage which is required for the package. - Support for
Uri\Rfc3986\UriandUri\Whatwg\Url
UriandHttpnormalization normalized IP against RFC3986 rules and not WHATWG rules.Uri::getOriginnow follows WHATWG cross-origin definitionUrihost encoding compliance to RFC3986 is improved by supporting RFC3986 encoded URI properlyUriparsing with strings started or ended with empty string are no longer allowedUrispace are rawurlencoded.
BasUriuse theUriclass or the uri-componentModifierclass depending on the needed requirement.
- None
7.5.0 - 2024-12-08
Uri::getUsernamereturns the encoded user component of the URI.Uri::getPasswordreturns the encoded password component of the URI.BaseUri::isOpaquetells whether a URI is opaque.- Using PHP8.4
Deprecatedattribute to signal deprecated public API methods and constants.
- Improve PSR-7
Httpclass implementation. BaseUri::fromwill compress the IPv6 host to its compressed form if possible.
- Usage of PSR-7
UriFactoryInterfaceis deprecated inBaseUriclass
- None
7.4.1 - 2024-02-23
- None
- Fix package to avoid PHP8.4 deprecation warnings
- None
- None
7.4.0 - 2023-12-01
Uri::fromDataUri::fromRfc8089BaseUri::unixPathBaseUri::windowsPathBaseUri::toRfc8089
- None
- None
- None
7.3.0 - 2023-09-09
- None
- URI Template incorrect when variable name only contains numbers #109 by GrahamCampbell
- Exception message typo fix #121 by GrahamCampbell
- None
- None
7.2.1 - 2023-08-30
- None
composer.jsonconstraints
- None
- None
7.2.0 - 2023-08-30
BasUri::hasIDN
- None
- None
- None
7.1.0 - 2023-08-21
- None
- Using the
Encoderclass to normalize encoding and decoding in all packages
- None
- None
7.0.0 - 2023-08-10
League\Uri\Uri::newLeague\Uri\Uri::fromComponentsLeague\Uri\Uri::fromServerLeague\Uri\Uri::fromWindowsPathLeague\Uri\Uri::fromUnixPathLeague\Uri\Uri::fromFileContentsLeague\Uri\Uri::fromClientLeague\Uri\Uri::fromTemplateLeague\Uri\Http::newLeague\Uri\Http::fromComponentsLeague\Uri\Http::fromBaseUriLeague\Uri\Http::fromServerLeague\Uri\Http::fromTemplateLeague\Uri\UriTemplate::expandOrFailLeague\Uri\UriTemplate\Template::expandOrFailLeague\Uri\UriTemplate\TemplateCanNotBeExpandedLeague\Uri\UriString::parseAuthorityLeague\Uri\UriString::buildAuthorityLeague\Uri\BaseUri
League\Uri\UriInfouri input now supportsStringableandstringtype.League\Uri\UriTemplate\VariableBagimplements theIteratorAggregateinterfaceLeague\Uri\UriTemplate\Operatorto improve internal representation when using UriTemplate features.
League\Uri\UriResolveruseLeague\Uri\BaseUriinsteadLeague\Uri\Uri::createFromStringuseLeague\Uri\Uri::newLeague\Uri\Uri::createFromUriuseLeague\Uri\Uri::newLeague\Uri\Uri::createFromComponentsuseLeague\Uri\Uri::fromComponentsLeague\Uri\Uri::createFromBaseUriuseLeague\Uri\Uri::fromBaseUriLeague\Uri\Uri::createFromServeruseLeague\Uri\Uri::fromServerLeague\Uri\Uri::createFromWindowsPathuseLeague\Uri\Uri::fromWindowsPathLeague\Uri\Uri::createFromUnixPathuseLeague\Uri\Uri::fromUnixPathLeague\Uri\Uri::createFromDataPathuseLeague\Uri\Uri::fromFileContentsLeague\Uri\Http::createFromStringuseLeague\Uri\Http::newLeague\Uri\Http::createFromUriuseLeague\Uri\Http::newLeague\Uri\Http::createFromComponentsuseLeague\Uri\Http::fromComponentsLeague\Uri\Http::createFromBaseUriuseLeague\Uri\Http::fromBaseUriLeague\Uri\Http::createFromServeruseLeague\Uri\Http::fromServerLeague\Uri\UriTemplate\Template::createFromStringuseLeague\Uri\UriTemplate\Template::new
- Support for
__set_state - Support for
__debugInfo League\Uri\UriTemplate\VariableBag::allLeague\Uri\Exceptions\TemplateCanNotBeExpandeduseLeague\Uri\UriTemplate\TemplateCanNotBeExpandedinsteadLeague\Uri\UriStringclass. Class moved to theuri-interfacespackage.
6.8.0 - 2022-09-13
- Added PHP8.2+
SensitiveParameterattributes to user information component
- Optimize URI performance for server intensive usage 206 by @kelunik
- Improve
Templateresolution - Added PHPBench to benchmark the package main functionnalities.
- Normalize
UriInterface::getPathvalue in the context of multiple leading slash characters.
- None
- Support for PHP7.4 and PHP8.0
6.7.2 - 2022-09-13
- None
Http::getPathandUri::getPathmethods returned values are normalized to prevent potential XSS and open redirect vectors.
- None
- None
6.7.1 - 2022-06-29
- None
UriInfo::isCrossOriginmethod is fix to make it work with any PSR-7 compliant object 205
- None
- None
6.7.0 - 2022-06-28
UriInfo::isCrossOriginmethod
- None
- None
- None
6.6.0 - 2022-05-28
- None
- Some errors are moved from
TypeErrortoInvalidArgumentExceptionto align with otherUriInterfacePSR-7 implementations. - Improved documentation by @GwendolenLynch
- Added PSR7 compliance tests from the PHP-HTTP group
- None
- Support for PHP7.3
Uri::toStringas a clean method to return URI string representation.IDNAconversion in now normalize using theUri-Interfacepackage classes
- conversion host component from ASCII to unicode no longer throw
- None
- Support for PHP7.2
HttpFactorya class that implements PSR-17 UriFactoryInterface. The package needs to be present for the class to work.
- Nothing
- None
UriInfo::getOriginto returns the URI origin as described in the WHATWG URL Living standard specificationUriTemplate\Template,UriTemplate\Expression,UriTemplate\VarSpecifier,UriTemplate\VariableBagto improveUriTemplateimplementation.- Added early support for PHP8
UriTemplatecomplete rewrite by reducing deep nested array usage.- Exception misleading message see issue #167
Uri::withSchemeUri validation failed to catch the empty string as an invalid scheme. #171
- Nothing
- None
- None
- Bugfix
UriTemplate::expandto comply with expansion rules for undefined variables #161 thanks Gabe Sullice - Improve package testing settings and environment.
- Nothing
- None
- None
- None
- Nothing
- Hard dependencies on the
ext-mbstringand theext-fileinfoPHP extensions #154 thanks Nicolas Grekas
- Nothing
League\Uri\UriTemplatevariables validation and normalization improved
- Nothing
- Nothing
League\Uri\UriTemplatea class to handle uri template expansion as described in RFC7560 see PR #153
- Nothing
- Nothing
- Nothing
Urishould not depend onintlextension if the host is in its ascii form #141
- Nothing
- Nothing
League\Uri\UriInfo: to get RFC3986 information from an URI objectLeague\Uri\UriResolver: to resolve or relativize an URI objectLeague\Uri\UriString: to parse or build an URL into or from its componentsLeague\Uri\Uri::createFromBaseUrinamed constructorLeague\Uri\Uri::createFromDataPathnamed constructorLeague\Uri\Uri::createFromPsr7named constructorLeague\Uri\Uri::createFromUnixPathnamed constructorLeague\Uri\Uri::createFromWindowsPathnamed constructorLeague\Uri\Http::createFromBaseUrinamed constructor
- Improve parsing and building URI
- All URI object are now finals and supports parameter type widening
League\Uri\Uriimplements theJsonSerializableinterfaceLeague\Uri\Httpimplements theJsonSerializableinterface
- None
- support for PHP7.1 and PHP7.0
createfunction defined in theLeague\Urinamespace replaced byLeague\Uri\Uri::createFromBaseUriLeague\Uri\Factoryreplaced byLeague\Uri\UriLeague\Uri\Datareplaced byLeague\Uri\UriLeague\Uri\Filereplaced byLeague\Uri\UriLeague\Uri\Ftpreplaced byLeague\Uri\UriLeague\Uri\Wsreplaced byLeague\Uri\UriLeague\Uri\UriExceptionreplaced byLeague\Uri\Contract\UriExceptionLeague\Uri\AbstractUriinternal, replaced byLeague\Uri\UriLeague\Uri\Schemesnamespace and all classes insideLeague\Uri\Urino longer implementsLeague\Uri\UriInterface
See packages release notes for more informations
- IPvFuture support
- Adding PHPStan
- Improve RFC3986 compliance
- Improve performance
- remove
mbstringextension requirement
- URI Parser
- URI Hostname parser
- URI Manipulations 1.3.0 Changelog
- URI Components 1.5.0 Changelog
- URI Schemes 1.1.1 Changelog
- Support for PHP7.2
- Support for PHP7.2
- Update library dependencies
- Nothing
- Nothing
The library is now a metapackage, you can read the migration guide for upgrading or the complete documentation for the new version.
- PHP5 support
- Nothing
- issue #91 Path modifier must be RFC3986 compliant
- issue #94 Improve Query parser encoder
Formatter::__invokepath must be RFC3986 compliant
- Nothing
- Nothing
- Nothing
- issue #84
- Nothing
- Nothing
Component::getContentreturns the raw encoded representation of a componentComponent::withContentto create a new instance from a given raw encoded contentgetDecodedmethod to access the decoded content for the following classes:UserPassFragment
- Support for PHP's magic methods
__debugInfoand__set_stateto improve debugging Modifiers\RelativizeModifiers\DecodeUnreservedCharactersPath::createFromSegmentsPath::getSegmentsHost::createFromLabelsHost::getLabelsQuery::createFromPairsQuery::getPairsModifiers\uri_referencefunction to return URI reference state.
- Components encoding/decoding to be more RFC3986 compliant
Host::getRegisterableDomainmust always return a string as per the host interface expected return typeHost::getSubdomainmust always return a string as per the host interface expected return typeHost::isPublicSuffixValidwhen nopublicSuffixinformation is foundHost::isPublicSuffixValidmust always return a string as per the host interface expected return type- On instantiation, query and fragment delimiter are preserved
createFromComponentsfailing withparse_urlresult when no path is defined- On URI transformation
InvalidArgumentExceptionexceptions are emitted instead ofRuntimeExceptionones to normalize exception to PSR-7 Modifiers\Normalizeclass removes dot segments only on URI with absolute path.Modifiers\Normalizeclass decode all unreserved characters.FtpandWsobjects now accept relative reference URI without the scheme.
Component::modifyuseComponent::withContentinsteadHost::getLiteralPort::toIntusePort::getContentinsteadHierarchicalPath::createFromArrayuseHierarchicalPath::createFromSegmentsinsteadHierarchicalPath::toArrayuseHierarchicalPath::getSegmentsinsteadHost::createFromArrayuseHost::createFromLabelsinsteadHost::toArrayuseHost::getLabelsinsteadQuery::createFromArrayuseQuery::createFromPairsinsteadQuery::toArrayuseQuery::getPairsinsteadUriPart::sameValueAs
- Nothing
- Nothing
- Bug fix path encoding issue #38
- Nothing
- Nothing
Formatter::preserveQueryto improve query inclusion in URI string representationFormatter::preserveFragmentto improve fragment inclusion in URI string representationFormatter::__invokeas an alias ofFormatter::formatUriParser::__invokeas an alias ofUriParser::parse
- Improve Uri Component modification issue #29
- Improve Path encoding/decoding issue #28
- Improve lowercase transformation in hostname issue #27
- Fix empty string evaluation issue #31
Formatter::getHostEncodingFormatter::getQueryEncodingFormatter::getQuerySeparatorModifiers\Filters\Flag::withFlagsModifiers\Filters\ForCallbable::withCallableModifiers\Filters\ForCallbable::withCallableModifiers\Filters\Keys::withKeysModifiers\Filters\Label::withLabelModifiers\Filters\Offset::withOffsetModifiers\Filters\QueryString::withQueryModifiers\Filters\Segment::withSegmentModifiers\Filters\Uri::withUriModifiers\DataUriParameters\withParametersModifiers\Extension\withExtensionModifiers\KsortQuery\withAlgorithmModifiers\Typecode\withType
- Nothing
- Nothing
UserandPassencodingHttp::createFromServerhandling userinfo when not usingmod_phpwith$_SERVER['HTTP_AUTHORIZATION']UriParserhandling URI strings with invalid schemeQueryParserhandling numeric index issue #25DataPathmimetype syntax validation issue #21DataPath::withParametersthe;base64binary code now always throw anInvalidArgumentException
- Nothing
- Nothing
Intlextension is now required to use the libraryFileInfoextension is now required to use the library- Domain parsing capabilities to
Hostusingjeremykendall/php-domain-parserpackage UriParserto parse an URI according to RFC3986 rulesQueryParserto parse and build a query string according to RFC3986 rules.League\Uri\Schemes\Generic\AbstractUrito enable better URI extension- URI Modifiers classes to modify URI objects in an uniform way for interoperability
- A
Dataclass to specifically manipulatedataschemed URI - A
Httpclass to specifically manipulatehttp,httpsschemed URI - A
Ftpclass to specifically manipulateftpschemed URI - A
Wsclass to specifically manipulatews,wssschemed URI - A
DataPathcomponent class to manipulate Data-uri path component - A
HierarchicalPathto manipulate Hierarchical-like path component - Support for IP host
- Move namespace from
League\UrltoLeague\Urito avoid dependency hell - Uri components classes are fixed to comply to
RFC3986 - Uri components classes are now all immutable value objects
- Nothing
- Support for
PHP 5.4andPHP 5.3 - Dependency on PHP
parse_url,parse_strandhttp_build_queryfunctions - Dependency on the
True/php-punycodelibrary League\Url\Url,League\Url\UrlImmutable,League\Url\UrlConstantsclasses- Most of the public API is removed