Download the PHP package glenscott/url-normalizer without Composer
On this page you can find all versions of the php package glenscott/url-normalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download glenscott/url-normalizer
More information about glenscott/url-normalizer
Files in glenscott/url-normalizer
Package url-normalizer
Short Description Syntax based normalization of URL's
License MIT
Informations about the package url-normalizer
Syntax based normalization of URI's
This normalizes URI's based on the specification RFC 3986 https://tools.ietf.org/html/rfc3986
Example usage
The normalization process preserves semantics
So, for example, the following URL's are all equivalent.
HTTP://www.Example.com/
andhttp://www.example.com/
http://www.example.com/a%c2%b1b
andhttp://www.example.com/a%C2%B1b
http://www.example.com/%7Eusername/
andhttp://www.example.com/~username/
http://www.example.com
andhttp://www.example.com/
http://www.example.com:80/bar.html
andhttp://www.example.com/bar.html
http://www.example.com/../a/b/../c/./d.html
andhttp://www.example.com/a/c/d.html
http://www.example.com/?array[key]=value
andhttp://www.example.com/?array%5Bkey%5D=value
Normalizations performed
- Converting the scheme and host to lower case
- Capitalizing letters in escape sequences
- Decoding percent-encoded octets of unreserved characters
- Adding trailing
/
- Removing the default port
- Removing dot-segments
For more information about these normalizations, please see the following Wikipedia article:
http://en.wikipedia.org/wiki/URL_normalization#Normalizations_that_Preserve_Semantics
For license information, please see LICENSE file.
Options
Two options are available when normalizing URLs which are disabled by default:
- Remove empty delimiters. Enabling this option would normalize
http://www.example.com/?
tohttp://www.example.com/
Currently, only the query string delimiter (?
) is supported by this option. - Sort query parameters. Enabling this option sorts the query parameters by key alphabetically. For example,
http://www.example.com/?c=3&b=2&a=1
becomeshttp://www.example.com/?a=1&b=2&c=3
TODO
Add further scheme-based normalization steps, as detailed in section 6.2.3 of the RFC.
All versions of url-normalizer with dependencies
ext-mbstring Version *