Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JURI

Description

JURI Class

This class serves two purposes. First to parse a URI and provide a common interface for the Joomla Framework to access and manipulate a URI. Second to attain the URI of the current executing script from the server regardless of server.

Located in /joomla/environment/uri.php (line 30)

Class JObject   (Subpackage Base)

Class JURI   (Subpackage Environment)
Variable Summary
Variable string $_fragment
Variable string $_host
Variable string $_pass
Variable string $_path
Variable integer $_port
Variable string $_query
Variable string $_scheme
Variable string $_uri
Variable string $_user
Variable array $_vars
Method Summary
Static method static JURI &getInstance ([string $uri = 'SERVER'])
Constructor JURI __construct ([string $uri = null])
Method string base ()
Method void delVar (string $name)
Method string getFragment ()
Method string getHost ()
Method string getPass ()
Method string getPath ()
Method int getPort ()
Method string getQuery ([ $toArray = false])
Method string getScheme ()
Method string getUser ()
Method array getVar ([string $name = null], [ $default = null])
Method boolean isSSL ()
Method boolean parse (string $uri)
Method void setFragment (string $anchor)
Method void setHost (string $host)
Method void setPass (string $pass)
Method void setPath (string $path)
Method void setPort (int $port)
Method void setQuery (mixed $query)
Method void setScheme (string $scheme)
Method void setUser (string $user)
Method string setVar (string $name, string $value)
Method string toString ([array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')])
Variables
string $_fragment = null (line 93)

Anchor

string $_host = null (line 51)

Host

string $_pass = null (line 72)

Password

string $_path = null (line 79)

Path

integer $_port = null (line 58)

Port

string $_query = null (line 86)

Query

string $_scheme = null (line 44)

Protocol

string $_uri = null (line 37)

Original URI

string $_user = null (line 65)

Username

array $_vars = array () (line 100)

Query variable hash

Methods
Constructor __construct (line 108)

Constructor.

You can pass a URI string to the constructor to initialize a specific URI.

JURI __construct ([string $uri = null])
  • string $uri: The optional URI string

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
base (line 192)

Returns the base URI for the request.

  • return: The base URI string
  • since: 1.5
  • access: public
string base ()
delVar (line 325)

Removes an item from the query string variables if it exists

  • since: 1.5
  • access: public
void delVar (string $name)
  • string $name: Name of variable to remove
getFragment (line 514)

Get the URI archor string everything after the "#"

  • return: The URI anchor string
  • since: 1.5
  • access: public
string getFragment ()
getHost (line 447)

Get URI host returns the hostname/ip, or null if no hostname/ip was specified

  • return: The URI host
  • since: 1.5
  • access: public
string getHost ()
getInstance (line 127)

Returns a reference to a global JURI object, only creating it if it doesn't already exist.

This method must be invoked as:

  $uri =& JURI::getInstance([$uri]);

  • return: The URI object.
  • since: 1.5
JURI &getInstance ([string $uri = 'SERVER'])
  • string $uri: The URI to parse. [optional: if null uses script URI]
getPass (line 424)

Get URI password returns the password, or null if no password was specified

  • return: The URI password
  • since: 1.5
  • access: public
string getPass ()
getPath (line 491)

Gets the URI path string

  • return: The URI path string
  • since: 1.5
  • access: public
string getPath ()
getPort (line 469)

Get URI port returns the port number, or null if no port was specified

  • return: The URI port number
  • access: public
int getPort ()
getQuery (line 361)

Returns flat query string

  • return: Query string
  • since: 1.5
  • access: public
string getQuery ([ $toArray = false])
  • $toArray
getScheme (line 377)

Get URI scheme (protocol) ie. http, https, ftp, etc...

  • return: The URI scheme
  • since: 1.5
  • access: public
string getScheme ()
getUser (line 401)

Get URI username returns the username, or null if no username was specified

  • return: The URI username
  • since: 1.5
  • access: public
string getUser ()
getVar (line 310)

Returns a query variable by name

  • return: Query variables
  • since: 1.5
  • access: public
array getVar ([string $name = null], [ $default = null])
  • string $name: Name of the query variable to get
  • $default
isSSL (line 537)

Checks whether the current URI is using HTTPS

  • return: True if using SSL via HTTPS
  • since: 1.5
  • access: public
boolean isSSL ()
parse (line 227)

Parse a given URI and populate the class fields

  • return: True on success
  • since: 1.5
  • access: public
boolean parse (string $uri)
  • string $uri: The URI string to parse
setFragment (line 526)

Set the URI anchor string everything after the "#"

  • since: 1.5
  • access: public
void setFragment (string $anchor)
  • string $anchor: The URI anchor string
setHost (line 458)

Set URI host

  • since: 1.5
  • access: public
void setHost (string $host)
  • string $host: The URI host
setPass (line 435)

Set URI password

  • since: 1.5
  • access: public
void setPass (string $pass)
  • string $pass: The URI password
setPath (line 502)

Set the URI path string

  • since: 1.5
  • access: public
void setPath (string $path)
  • string $path: The URI path string
setPort (line 480)

Set URI port

  • since: 1.5
  • access: public
void setPort (int $port)
  • int $port: The URI port number
setQuery (line 341)

Sets the query to a supplied string in format: foo=bar&x=y

  • since: 1.5
  • access: public
void setQuery (mixed $query)
  • mixed $query: (array|string) $query The query string
setScheme (line 389)

Set URI scheme (protocol) ie. http, https, ftp, etc...

  • since: 1.5
  • access: public
void setScheme (string $scheme)
  • string $scheme: The URI scheme
setUser (line 412)

Set URI username

  • since: 1.5
  • access: public
void setUser (string $user)
  • string $user: The URI username
setVar (line 294)

Adds a query variable and value, replacing the value if it already exists and returning the old value.

  • return: Previous value for the query variable
  • since: 1.5
  • access: public
string setVar (string $name, string $value)
  • string $name: Name of the query variable to set
  • string $value: Value of the query variable
toString (line 269)

Returns full uri string

  • return: The rendered URI string
  • since: 1.5
  • access: public
string toString ([array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')])
  • array $parts: An array specifying the parts to render

Redefinition of:
JObject::toString()
Object-to-string conversion.

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getPublicProperties()
 JObject::set()
 JObject::toString()

Documentation generated on Mon, 05 Mar 2007 21:30:07 +0000 by phpDocumentor 1.3.1