ts3phpframework
Loading...
Searching...
No Matches
PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri Class Reference

Helper class for URI handling. More...

Public Member Functions

 __construct (string $uri)
 isValid ()
 hasScheme ()
 getScheme (mixed $default=null)
 checkUser (string $username=null)
 hasUser ()
 getUser (mixed $default=null)
 checkPass (StringHelper|string $password=null)
 hasPass ()
 getPass (mixed $default=null)
 checkHost (string $host=null)
 hasHost ()
 getHost (mixed $default=null)
 checkPort (int $port=null)
 hasPort ()
 getPort (mixed $default=null)
 checkPath (string $path=null)
 hasPath ()
 getPath (string $default="/")
 checkQuery (string $query=null)
 hasQuery ()
 getQuery (array $default=[])
 hasQueryVar ($key)
 getQueryVar (string $key, mixed $default=null)
 checkFragment (string $fragment=null)
 hasFragment ()
 getFragment (mixed $default=null)

Static Public Member Functions

static check (StringHelper $uri)
static getUserParam (string $key, mixed $default=null)
static getHostParam (string $key, mixed $default=null)
static getSessParam (string $key, mixed $default=null)
static getFQDNParts (string $hostname)
static getHostUri ()
static getBaseUri ()

Protected Member Functions

 parseUri (string $uriString='')

Static Protected Member Functions

static stripslashesRecursive (mixed $var)

Protected Attributes

StringHelper string null $scheme = null
StringHelper $user = null
StringHelper $pass = null
StringHelper $host = null
StringHelper $port = null
StringHelper $path = null
StringHelper $query = null
StringHelper $fragment = null
array $regex = []

Detailed Description

Helper class for URI handling.

Definition at line 13 of file Uri.php.

Constructor & Destructor Documentation

◆ __construct()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::__construct ( string $uri)

Uri constructor.

Parameters
string$uri
Exceptions
HelperException

Definition at line 84 of file Uri.php.

Member Function Documentation

◆ check()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::check ( StringHelper $uri)
static

Returns TRUE if a given URI is valid.

Parameters
StringHelper$uri
Returns
boolean
Exceptions
HelperException

Definition at line 161 of file Uri.php.

◆ checkFragment()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkFragment ( string $fragment = null)

Returns TRUE if the fragment string is valid.

Parameters
string | null$fragment
Returns
boolean
Exceptions
HelperException

Definition at line 544 of file Uri.php.

◆ checkHost()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkHost ( string $host = null)

Returns TRUE if the host is valid.

Parameters
string | null$host
Returns
boolean

Definition at line 295 of file Uri.php.

◆ checkPass()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkPass ( StringHelper|string $password = null)

Returns TRUE if the password is valid.

Parameters
StringHelper | string | null$password
Returns
boolean
Exceptions
HelperException

Definition at line 248 of file Uri.php.

◆ checkPath()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkPath ( string $path = null)

Returns TRUE if the path is valid.

Parameters
string | null$path
Returns
boolean
Exceptions
HelperException

Definition at line 395 of file Uri.php.

◆ checkPort()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkPort ( int $port = null)

Returns TRUE if the port is valid.

Parameters
integer | null$port
Returns
boolean

Definition at line 346 of file Uri.php.

◆ checkQuery()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkQuery ( string $query = null)

Returns TRUE if the query string is valid.

Parameters
string | null$query
Returns
boolean
Exceptions
HelperException

Definition at line 443 of file Uri.php.

◆ checkUser()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::checkUser ( string $username = null)

Returns TRUE if the username is valid.

Parameters
string | null$username
Returns
boolean
Exceptions
HelperException

Definition at line 200 of file Uri.php.

◆ getBaseUri()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getBaseUri ( )
static

Returns the applications base address.

Returns
StringHelper

Definition at line 666 of file Uri.php.

◆ getFQDNParts()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getFQDNParts ( string $hostname)
static

Returns an array containing the three main parts of a FQDN (Fully Qualified Domain Name), including the top-level domain, the second-level domains or hostname and the third-level domain.

Parameters
string$hostname
Returns
array

Definition at line 628 of file Uri.php.

◆ getFragment()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getFragment ( mixed $default = null)

Returns the fragment.

Parameters
mixed | null$default
Returns
StringHelper|null

Definition at line 580 of file Uri.php.

◆ getHost()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getHost ( mixed $default = null)

Returns the host.

Parameters
mixed | null$default
Returns
StringHelper|null

Definition at line 335 of file Uri.php.

◆ getHostParam()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getHostParam ( string $key,
mixed $default = null )
static

Returns a specified environment parameter from the $_SERVER array.

Parameters
string$key
mixed | null$default
Returns
mixed

Definition at line 604 of file Uri.php.

◆ getHostUri()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getHostUri ( )
static

Returns the applications host address.

Returns
StringHelper

Definition at line 646 of file Uri.php.

◆ getPass()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getPass ( mixed $default = null)

Returns the password.

Parameters
mixed | null$defaultdefault
Returns
StringHelper|null

Definition at line 284 of file Uri.php.

◆ getPath()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getPath ( string $default = "/")

Returns the path.

Parameters
mixed | null$default
Returns
StringHelper

Definition at line 431 of file Uri.php.

◆ getPort()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getPort ( mixed $default = null)

Returns the port.

Parameters
mixed | null$default
Returns
integer

Definition at line 383 of file Uri.php.

◆ getQuery()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getQuery ( array $default = [])

Returns an array containing the query string elements.

Parameters
mixed | array$default
Returns
array

Definition at line 479 of file Uri.php.

◆ getQueryVar()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getQueryVar ( string $key,
mixed $default = null )

Returns a single variable from the query string.

Parameters
string$key
mixed | null$default
Returns
mixed

Definition at line 514 of file Uri.php.

◆ getScheme()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getScheme ( mixed $default = null)

Returns the scheme.

Parameters
mixed | null$default
Returns
StringHelper|null

Definition at line 188 of file Uri.php.

◆ getSessParam()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getSessParam ( string $key,
mixed $default = null )
static

Returns a specified session parameter from the $_SESSION array.

Parameters
string$key
mixed | null$default
Returns
mixed

Definition at line 616 of file Uri.php.

◆ getUser()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getUser ( mixed $default = null)

Returns the username.

Parameters
mixed | null$default
Returns
StringHelper|null

Definition at line 236 of file Uri.php.

◆ getUserParam()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::getUserParam ( string $key,
mixed $default = null )
static

Returns a specified instance parameter from the $_REQUEST array.

Parameters
string$key
mixed | null$default
Returns
mixed

Definition at line 592 of file Uri.php.

◆ hasFragment()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasFragment ( )

Returns TRUE if the URI has a fragment string.

Returns
boolean

Definition at line 569 of file Uri.php.

◆ hasHost()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasHost ( )

Returns TRUE if the URI has a host.

Returns
boolean

Definition at line 324 of file Uri.php.

◆ hasPass()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasPass ( )

Returns TRUE if the URI has a password.

Returns
boolean

Definition at line 273 of file Uri.php.

◆ hasPath()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasPath ( )

Returns TRUE if the URI has a path.

Returns
boolean

Definition at line 420 of file Uri.php.

◆ hasPort()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasPort ( )

Returns TRUE if the URI has a port.

Returns
boolean

Definition at line 372 of file Uri.php.

◆ hasQuery()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasQuery ( )

Returns TRUE if the URI has a query string.

Returns
boolean

Definition at line 468 of file Uri.php.

◆ hasQueryVar()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasQueryVar ( $key)

Returns TRUE if the URI has a query variable.

Parameters
$key
Returns
boolean

Definition at line 496 of file Uri.php.

◆ hasScheme()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasScheme ( )

Returns TRUE if the URI has a scheme.

Returns
boolean

Definition at line 177 of file Uri.php.

◆ hasUser()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::hasUser ( )

Returns TRUE if the URI has a username.

Returns
boolean

Definition at line 225 of file Uri.php.

◆ isValid()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::isValid ( )

Validate the current URI from the instance variables.

Returns
boolean
Exceptions
HelperException

Definition at line 149 of file Uri.php.

◆ parseUri()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::parseUri ( string $uriString = '')
protected

Parses the scheme-specific portion of the URI and place its parts into instance variables.

Parameters
string$uriString
Returns
void
Exceptions
HelperException

Definition at line 114 of file Uri.php.

◆ stripslashesRecursive()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::stripslashesRecursive ( mixed $var)
staticprotected

Strips slashes from each element of an array using stripslashes().

Parameters
mixed$var
Returns
string|array

Definition at line 679 of file Uri.php.

Member Data Documentation

◆ $fragment

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$fragment = null
protected

Definition at line 69 of file Uri.php.

◆ $host

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$host = null
protected

Definition at line 41 of file Uri.php.

◆ $pass

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$pass = null
protected

Definition at line 34 of file Uri.php.

◆ $path

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$path = null
protected

Definition at line 55 of file Uri.php.

◆ $port

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$port = null
protected

Definition at line 48 of file Uri.php.

◆ $query

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$query = null
protected

Definition at line 62 of file Uri.php.

◆ $regex

array PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$regex = []
protected

Definition at line 76 of file Uri.php.

◆ $scheme

StringHelper string null PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$scheme = null
protected

Definition at line 20 of file Uri.php.

◆ $user

StringHelper PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri::$user = null
protected

Definition at line 27 of file Uri.php.


The documentation for this class was generated from the following file: