From Joomla! Documentation
Revision as of 08:21, 23 March 2010 by Chris Davenport
JURI provides a number of methods and properties for handling Uniform Resource Identifiers (URIs). It also provides a means of obtaining the URI of the current request regardless of the web server on which Joomla is running.
The formal structure of a URI is defined in RFC3986 and the following is an example taken from that document:
foo://example.com:8042/over/there?name=ferret#nose \_/ \______________/\_________/ \_________/ \__/ | | | | | scheme authority path query fragment
The scheme and path components are required, though the path may be empty (no characters). When authority is present, the path must either be empty or begin with a slash ("/") character. When authority is not present, the path cannot begin with two slash characters ("//").
The scheme usually specifies the internet protocol that is to be used to access the resource. For example, 'http' indicates that the HyperText Transfer Protocol is to be used.
The authority field can be sub-divided into user information, host and port number parts. The user information part allows a URI to contain authentication information, usually in the form 'username:password', although this format is deprecated as "The passing of authentication information in clear text has proven to be a security risk in almost every case where it has been used." However, as URIs containing authentication information are still available on the internet, the JURI class will continue to support the generation and parsing of user authentication information.
The query part may contain multiple items, separated by '&' characters.
The JURI class effectively provides a wrapper around the PHP parse_url function.