class uKnowvaURI extends JURI


Located at : UKNOWVA_ROOT/libraries/joomla/environment/uri.php

Methods

__construct(string $uri = null)

Constructor.

string
__toString()

Magic method to get the string representation of the URI object.

from JURI
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))

Returns full uri string.

from JURI
static JURI
getInstance(string $uri = 'SERVER')

Returns the global JURI object, only creating it if it doesn't already exist.

from JURI
static string
base(boolean $pathonly = false)

Returns the base URI for the request.

from JURI
static string
root($pathonly = false, $path = null)

Returns the root URI for the request.

from JURI
static string
current()

Returns the URL for the request, minus the query.

from JURI
static void
reset()

Method to reset class static members for testing and other various issues.

from JURI
boolean
parse(string $uri)

Parse a given URI and populate the class fields.

from JURI
string
setVar(string $name, string $value)

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

from JURI
bool
hasVar(string $name)

Checks if variable exists.

from JURI
array
getVar(string $name, string $default = null)

Returns a query variable by name.

from JURI
void
delVar(string $name)

Removes an item from the query string variables if it exists.

from JURI
void
setQuery(mixed(array|string) $query)

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

from JURI
string
getQuery(boolean $toArray = false)

Returns flat query string.

from JURI
static string
buildQuery($params)

Build a query from a array (reverse of the PHP parse_str()).

from JURI
string
getScheme()

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

from JURI
void
setScheme(string $scheme)

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

from JURI
string
getUser()

Get URI username Returns the username, or null if no username was specified.

from JURI
void
setUser(string $user)

Set URI username.

from JURI
string
getPass()

Get URI password Returns the password, or null if no password was specified.

from JURI
void
setPass(string $pass)

Set URI password.

from JURI
string
getHost()

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

from JURI
void
setHost(string $host)

Set URI host.

from JURI
integer
getPort()

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

from JURI
void
setPort(integer $port)

Set URI port.

from JURI
string
getPath()

Gets the URI path string.

from JURI
void
setPath(string $path)

Set the URI path string.

from JURI
string
getFragment()

Get the URI archor string Everything after the "#".

from JURI
void
setFragment(string $anchor)

Set the URI anchor string everything after the "#".

from JURI
boolean
isSSL()

Checks whether the current URI is using HTTPS.

from JURI
static boolean
isInternal(string $url)

Checks if the supplied URL is internal

from JURI
mixed
getContentInfo()

Given a URL, this function gets the brief information on its content .i.e. title, description, images, baseurl, author, etc.

from JURI
string
getCurrentURL()

returns the complete current URL along with the query string parameters

Details

at line 856
JObject __construct(string $uri = null)

Constructor.

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

Parameters

string $uri The optional URI string

Return Value

JObject

in JURI at line 132
string __toString()

Magic method to get the string representation of the URI object.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JURI at line 349
string toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))

Returns full uri string.

Parameters

array $parts An array specifying the parts to render.

Return Value

string

in JURI at line 146
static JURI getInstance(string $uri = 'SERVER')

Returns the global JURI object, only creating it if it doesn't already exist.

Parameters

string $uri The URI to parse. [optional: if null uses script URI]

Return Value

JURI The URI object.

in JURI at line 202
static string base(boolean $pathonly = false)

Returns the base URI for the request.

Parameters

boolean $pathonly If false, prepend the scheme, host and port information. Default is false.

Return Value

string The base URI string

in JURI at line 248
static string root($pathonly = false, $path = null)

Returns the root URI for the request.

Parameters

$pathonly
$path

Return Value

string The root URI string.

in JURI at line 271
static string current()

Returns the URL for the request, minus the query.

Return Value

string

in JURI at line 288
static void reset()

Method to reset class static members for testing and other various issues.

Return Value

void

in JURI at line 304
boolean parse(string $uri)

Parse a given URI and populate the class fields.

Parameters

string $uri The URI string to parse.

Return Value

boolean True on success.

in JURI at line 378
string setVar(string $name, string $value)

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

Parameters

string $name Name of the query variable to set.
string $value Value of the query variable.

Return Value

string Previous value for the query variable.

in JURI at line 398
bool hasVar(string $name)

Checks if variable exists.

Parameters

string $name Name of the query variable to check.

Return Value

bool exists.

in JURI at line 413
array getVar(string $name, string $default = null)

Returns a query variable by name.

Parameters

string $name Name of the query variable to get.
string $default Default value to return if the variable is not set.

Return Value

array Query variables.

in JURI at line 430
void delVar(string $name)

Removes an item from the query string variables if it exists.

Parameters

string $name Name of variable to remove.

Return Value

void

in JURI at line 450
void setQuery(mixed(array|string) $query)

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

Parameters

mixed(array|string) $query The query string.

Return Value

void

in JURI at line 474
string getQuery(boolean $toArray = false)

Returns flat query string.

Parameters

boolean $toArray

Return Value

string Query string.

in JURI at line 496
static string buildQuery($params)

Build a query from a array (reverse of the PHP parse_str()).

Parameters

$params

Return Value

string $params The resulting query string.

See also

parse_str()

in JURI at line 512
string getScheme()

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

..

Return Value

string The URI scheme.

in JURI at line 527
void setScheme(string $scheme)

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

..

Parameters

string $scheme The URI scheme.

Return Value

void

in JURI at line 539
string getUser()

Get URI username Returns the username, or null if no username was specified.

Return Value

string The URI username.

in JURI at line 553
void setUser(string $user)

Set URI username.

Parameters

string $user The URI username.

Return Value

void

in JURI at line 565
string getPass()

Get URI password Returns the password, or null if no password was specified.

Return Value

string The URI password.

in JURI at line 579
void setPass(string $pass)

Set URI password.

Parameters

string $pass The URI password.

Return Value

void

in JURI at line 591
string getHost()

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

Return Value

string The URI host.

in JURI at line 605
void setHost(string $host)

Set URI host.

Parameters

string $host The URI host.

Return Value

void

in JURI at line 616
integer getPort()

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

Return Value

integer The URI port number.

in JURI at line 630
void setPort(integer $port)

Set URI port.

Parameters

integer $port The URI port number.

Return Value

void

in JURI at line 641
string getPath()

Gets the URI path string.

Return Value

string The URI path string.

in JURI at line 655
void setPath(string $path)

Set the URI path string.

Parameters

string $path The URI path string.

Return Value

void

in JURI at line 667
string getFragment()

Get the URI archor string Everything after the "#".

Return Value

string The URI anchor string.

in JURI at line 682
void setFragment(string $anchor)

Set the URI anchor string everything after the "#".

Parameters

string $anchor The URI anchor string.

Return Value

void

in JURI at line 693
boolean isSSL()

Checks whether the current URI is using HTTPS.

Return Value

boolean True if using SSL via HTTPS.

in JURI at line 707
static boolean isInternal(string $url)

Checks if the supplied URL is internal

Parameters

string $url The URL to check.

Return Value

boolean True if Internal.

in JURI at line 773
mixed getContentInfo()

Given a URL, this function gets the brief information on its content .i.e. title, description, images, baseurl, author, etc.

It parses the meta tags and page contents/images to get this informction This function is used by the URL share feature of uKnowva

Return Value

mixed An associative array with following keys url: The given URL title: The page Title images: An array of images with their absolute paths description: The description of the page host: The hostname like www.uknowva.com, etc. baseurl: The base url author: The author of the page if any OR Null in case of failure

at line 863
string getCurrentURL()

returns the complete current URL along with the query string parameters

Return Value

string the complete current URL along with the query string parameters