Documentation

Dsn extends Uri
in package
implements IDsn

FinalYes
Tags
author

Ramone Burrell ramone@ramoneburrell.com

Table of Contents

Interfaces

IDsn

Properties

$authority  : string
$charset  : string
$database  : string
$encryption_key  : string
$fragment  : string
$host  : string
$information_schema  : string
$name  : string
$password  : string
$path  : string
$port  : int
$query  : string
$scheme  : string
$user_info  : string
$username  : string
$hashCode  : int
$hashCounter  : int
$password_encoded  : bool
$uri  : string
The explicit representation of this URI

Methods

__call()  : mixed
__callStatic()  : mixed
__construct()  : mixed
__destruct()  : mixed
__get()  : mixed
__toString()  : string
Return the string representation as a URI reference. Depending on which components of the URI are present, the resulting string is either a full URI or relative reference according to RFC 3986, Section 4.1. The method concatenates the various components of the URI, using the appropriate delimiters: - If a scheme is present, it MUST be suffixed by ":". - If an authority is present, it MUST be prefixed by "//". - The path can be concatenated without delimiters. But there are two cases where the path has to be adjusted to make the URI reference valid as PHP does not allow to throw an exception in __toString(): - If the path is rootless and an authority is present, the path MUST be prefixed by "/". - If the path is starting with more than one "/" and no authority is present, the starting slashes MUST be reduced to one. - If a query is present, it MUST be prefixed by "?". - If a fragment is present, it MUST be prefixed by "#".
create()  : DataUri
extends()  : bool
getAuthority()  : string
Retrieve the authority component of the URI. If no authority information is present, this method MUST return an empty string. The authority syntax of the URI is: <pre> [user-info@]host[:port] </pre> If the port component is not set or is the standard port for the current scheme, it SHOULD NOT be included.
getCharSet()  : string|null
getDatabase()  : string
getDiver()  : string
*
getEncryptionKey()  : string|null
getFragment()  : string
Retrieve the fragment component of the URI. If no fragment is present, this method MUST return an empty string. The leading "#" character is not part of the fragment and MUST NOT be added. The value returned MUST be percent-encoded, but MUST NOT double-encode any characters.
getHost()  : string
Retrieve the host component of the URI. If no host is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.2.2.
getInformationSchema()  : string
Gets the DSN name for the informations schema for this DSN
getName()  : string
getPassword()  : string
getPath()  : string
Retrieve the path component of the URI. The path can either be empty or absolute (starting with a slash) or rootless (not starting with a slash). Implementations MUST support all three syntaxes. Normally, the empty path "" and absolute path "/" are considered equal as defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically do this normalization because in contexts with a trimmed base path, e.g. the front controller, this difference becomes significant. It's the task of the user to handle both "" and "/". The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.3. As an example, if the value should include a slash ("/") not intended as delimiter between path segments, that value MUST be passed in encoded form (e.g., "%2F") to the instance.
getPort()  : null|int
Retrieve the port component of the URI. If a port is present, and it is non-standard for the current scheme, this method MUST return it as an integer. If the port is the standard port used with the current scheme, this method SHOULD return null. If no port is present, and no scheme is present, this method MUST return a null value. If no port is present, but a scheme is present, this method MAY return the standard port for that scheme, but SHOULD return null.
getQuery()  : string
Retrieve the query string of the URI. If no query string is present, this method MUST return an empty string. The leading "?" character is not part of the query and MUST NOT be added.
getReflection()  : ReflectionClass
getScheme()  : string
Retrieve the scheme component of the URI. If no scheme is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.1.
getSchemePort()  : string|null
Gets the default scheme used for a particular URI scheme
getUserInfo()  : string
Retrieve the user information component of the URI. If no user information is present, this method MUST return an empty string. If a user is present in the URI, this will return that value; additionally, if the password is also present, it will be appended to the user value, with a colon (":") separating the values. The trailing "@" character is not part of the user information and MUST NOT be added.
getUsername()  : string
parse()  : string
Parses a DSN array to a an instane of Wolfgang\Interfaces\Network\IDsn
init()  : mixed
{@inheritdoc}
setCharSet()  : mixed
setEncryptionKey()  : mixed
setAuthority()  : mixed
setDatabase()  : mixed
setFragment()  : mixed
setHost()  : mixed
setInformationSchema()  : mixed
setName()  : mixed
setPassword()  : mixed
setPath()  : mixed
setPort()  : mixed
setQuery()  : mixed
setScheme()  : mixed
setUserInfo()  : mixed
setUsername()  : mixed

Properties

$encryption_key

protected string $encryption_key

$information_schema

protected string $information_schema

$password_encoded

private bool $password_encoded = false

$uri

The explicit representation of this URI

private string $uri

Methods

__callStatic()

public static __callStatic(mixed $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : mixed
$arguments : array<string|int, mixed>

__get()

public __get(string $property) : mixed
Parameters
$property : string

__toString()

Return the string representation as a URI reference. Depending on which components of the URI are present, the resulting string is either a full URI or relative reference according to RFC 3986, Section 4.1. The method concatenates the various components of the URI, using the appropriate delimiters: - If a scheme is present, it MUST be suffixed by ":". - If an authority is present, it MUST be prefixed by "//". - The path can be concatenated without delimiters. But there are two cases where the path has to be adjusted to make the URI reference valid as PHP does not allow to throw an exception in __toString(): - If the path is rootless and an authority is present, the path MUST be prefixed by "/". - If the path is starting with more than one "/" and no authority is present, the starting slashes MUST be reduced to one. - If a query is present, it MUST be prefixed by "?". - If a fragment is present, it MUST be prefixed by "#".

public __toString() : string
Tags
see
Component::__toString()
Return values
string

extends()

public extends(ReflectionClass $reflector) : bool
Parameters
$reflector : ReflectionClass
Return values
bool

getAuthority()

Retrieve the authority component of the URI. If no authority information is present, this method MUST return an empty string. The authority syntax of the URI is: <pre> [user-info@]host[:port] </pre> If the port component is not set or is the standard port for the current scheme, it SHOULD NOT be included.

public getAuthority() : string
Tags
see
IUri::getAuthority()
Return values
string

The URI authority, in "[user-info@]host[:port]" format.

getCharSet()

public getCharSet() : string|null
Return values
string|null

getEncryptionKey()

public getEncryptionKey() : string|null
Return values
string|null

getFragment()

Retrieve the fragment component of the URI. If no fragment is present, this method MUST return an empty string. The leading "#" character is not part of the fragment and MUST NOT be added. The value returned MUST be percent-encoded, but MUST NOT double-encode any characters.

public getFragment() : string
Tags
see
IUri::getFragment()
Return values
string

The URI fragment.

getHost()

Retrieve the host component of the URI. If no host is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.2.2.

public getHost() : string
Tags
see
IUri::getHost()
Return values
string

The URI host.

getInformationSchema()

Gets the DSN name for the informations schema for this DSN

public getInformationSchema() : string
Return values
string

getName()

public getName() : string
Return values
string

getPath()

Retrieve the path component of the URI. The path can either be empty or absolute (starting with a slash) or rootless (not starting with a slash). Implementations MUST support all three syntaxes. Normally, the empty path "" and absolute path "/" are considered equal as defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically do this normalization because in contexts with a trimmed base path, e.g. the front controller, this difference becomes significant. It's the task of the user to handle both "" and "/". The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.3. As an example, if the value should include a slash ("/") not intended as delimiter between path segments, that value MUST be passed in encoded form (e.g., "%2F") to the instance.

public getPath() : string
Tags
see
IUri::getPath()
Return values
string

The URI path.

getPort()

Retrieve the port component of the URI. If a port is present, and it is non-standard for the current scheme, this method MUST return it as an integer. If the port is the standard port used with the current scheme, this method SHOULD return null. If no port is present, and no scheme is present, this method MUST return a null value. If no port is present, but a scheme is present, this method MAY return the standard port for that scheme, but SHOULD return null.

public getPort() : null|int
Tags
see
IUri::getPort()
Return values
null|int

The URI port.

getQuery()

Retrieve the query string of the URI. If no query string is present, this method MUST return an empty string. The leading "?" character is not part of the query and MUST NOT be added.

public getQuery() : string
Tags
see
IUri::getQuery()
Return values
string

The URI query string.

getReflection()

public getReflection() : ReflectionClass
Return values
ReflectionClass

getScheme()

Retrieve the scheme component of the URI. If no scheme is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.1.

public getScheme() : string
Tags
see
IUri::getScheme()
Return values
string

The URI scheme.

getSchemePort()

Gets the default scheme used for a particular URI scheme

public static getSchemePort(string $uri_scheme) : string|null
Parameters
$uri_scheme : string
Return values
string|null

getUserInfo()

Retrieve the user information component of the URI. If no user information is present, this method MUST return an empty string. If a user is present in the URI, this will return that value; additionally, if the password is also present, it will be appended to the user value, with a colon (":") separating the values. The trailing "@" character is not part of the user information and MUST NOT be added.

public getUserInfo() : string
Tags
see
IUri::getUserInfo()
Return values
string

The URI user information, in "username[:password]" format.

parse()

Parses a DSN array to a an instane of Wolfgang\Interfaces\Network\IDsn

public static parse(array<string|int, mixed> $dsn) : string
Parameters
$dsn : array<string|int, mixed>
Return values
string

setAuthority()

private setAuthority(string $authority) : mixed
Parameters
$authority : string

setDatabase()

private setDatabase(string $database) : mixed
Parameters
$database : string

setFragment()

private setFragment(string $fragment) : mixed
Parameters
$fragment : string

setHost()

private setHost(string $host) : mixed
Parameters
$host : string

setInformationSchema()

private setInformationSchema(string $information_schema) : mixed
Parameters
$information_schema : string

setName()

private setName(string $name) : mixed
Parameters
$name : string

setPassword()

private setPassword(string $password) : mixed
Parameters
$password : string

setPath()

private setPath(string $path) : mixed
Parameters
$path : string

setPort()

private setPort(int $port) : mixed
Parameters
$port : int

setQuery()

private setQuery(string $query) : mixed
Parameters
$query : string

setScheme()

private setScheme(string $scheme) : mixed
Parameters
$scheme : string

setUserInfo()

private setUserInfo(string $user_info) : mixed
Parameters
$user_info : string

setUsername()

private setUsername(string $username) : mixed
Parameters
$username : string

        
On this page

Search results