ContentUri extends Uri
Class ContentUri marks uri which provides content (file content).
It gives chance to process uri by some rest application without any bearer tokens. So, module "rest" converts ContentUri to two items. One of them is original uri and second is machine uri.
Table of Contents
Methods
- __construct() : mixed
- __toString() : string
- addParams() : $this
- Adds parameters to query or replaces existing ones.
- convertToPunycode() : string|Error
- Converts the host to punycode.
- convertToUnicode() : string|Error
- Converts the host to Unicode.
- deleteParams() : $this
- Deletes parameters from the query.
- getAuthority() : string
- getFragment() : string
- getHost() : string
- getLocator() : string
- Return the URI without a fragment.
- getPass() : string
- Returns the rawurlencoded password.
- getPath() : string
- getPathQuery() : string
- Returns the path with the query.
- getPort() : int|null
- getQuery() : string
- getScheme() : string
- getUri() : string
- Return the URI with a fragment, if any.
- getUrl() : mixed
- getUser() : string
- Returns the rawurlencoded user.
- getUserInfo() : string
- isPathTraversal() : bool
- Searches for /../ and ulrencoded /../
- jsonSerialize() : string
- Specify data which should be serialized to JSON
- resolveRelativeUri() : $this
- Converts the relative URI to the absolute one within a context of a base URI.
- setHost() : $this
- Sets the host
- setPass() : $this
- Decodes and sets the password.
- setPath() : $this
- Sets the path.
- setUser() : $this
- Decodes and sets the user.
- toAbsolute() : $this
- Converts a relative uri to the absolute one using given host name or the host from the current context server object.
- urnDecode() : string
- Decodes the URI string without parsing it.
- urnEncode() : string
- Encodes the URI string without parsing it.
- withFragment() : UriInterface
- withHost() : UriInterface
- withPath() : UriInterface
- withPort() : UriInterface
- withQuery() : UriInterface
- withScheme() : UriInterface
- withUserInfo() : UriInterface
Methods
__construct()
public
__construct(string $url) : mixed
Parameters
- $url : string
__toString()
public
__toString() : string
Tags
Return values
stringaddParams()
Adds parameters to query or replaces existing ones.
public
addParams(array<string|int, mixed> $params[, bool $preserveDots = false ]) : $this
Parameters
- $params : array<string|int, mixed>
-
Parameters to add.
- $preserveDots : bool = false
-
Special treatment of dots and spaces in the parameters names.
Return values
$thisconvertToPunycode()
Converts the host to punycode.
public
convertToPunycode() : string|Error
Return values
string|ErrorconvertToUnicode()
Converts the host to Unicode.
public
convertToUnicode() : string|Error
Return values
string|ErrordeleteParams()
Deletes parameters from the query.
public
deleteParams(array<string|int, mixed> $params[, bool $preserveDots = false ]) : $this
Parameters
- $params : array<string|int, mixed>
-
Parameters to delete.
- $preserveDots : bool = false
-
Special treatment of dots and spaces in the parameters names.
Return values
$thisgetAuthority()
public
getAuthority() : string
Tags
Return values
stringgetFragment()
public
getFragment() : string
Tags
Return values
stringgetHost()
public
getHost() : string
Tags
Return values
stringgetLocator()
Return the URI without a fragment.
public
getLocator() : string
Return values
stringgetPass()
Returns the rawurlencoded password.
public
getPass() : string
Return values
stringgetPath()
public
getPath() : string
Tags
Return values
stringgetPathQuery()
Returns the path with the query.
public
getPathQuery() : string
Return values
stringgetPort()
public
getPort() : int|null
Tags
Return values
int|nullgetQuery()
public
getQuery() : string
Tags
Return values
stringgetScheme()
public
getScheme() : string
Tags
Return values
stringgetUri()
Return the URI with a fragment, if any.
public
getUri() : string
Return values
stringgetUrl()
public
getUrl() : mixed
Use getLocator() or getUri().
getUser()
Returns the rawurlencoded user.
public
getUser() : string
Return values
stringgetUserInfo()
public
getUserInfo() : string
Tags
Return values
stringisPathTraversal()
Searches for /../ and ulrencoded /../
public
isPathTraversal() : bool
Return values
booljsonSerialize()
Specify data which should be serialized to JSON
public
jsonSerialize() : string
Tags
Return values
string —data which can be serialized by json_encode, which is a value of any type other than a resource.
resolveRelativeUri()
Converts the relative URI to the absolute one within a context of a base URI.
public
resolveRelativeUri(Uri $base) : $this
Parameters
- $base : Uri
Tags
Return values
$thissetHost()
Sets the host
public
setHost(string $host) : $this
Parameters
- $host : string
-
Host name.
Return values
$thissetPass()
Decodes and sets the password.
public
setPass(string $pass) : $this
Parameters
- $pass : string
-
Password,
Return values
$thissetPath()
Sets the path.
public
setPath(string $path) : $this
Parameters
- $path : string
Return values
$thissetUser()
Decodes and sets the user.
public
setUser(string $user) : $this
Parameters
- $user : string
-
User.
Return values
$thistoAbsolute()
Converts a relative uri to the absolute one using given host name or the host from the current context server object.
public
toAbsolute([string|null $host = null ]) : $this
Parameters
- $host : string|null = null
Return values
$thisurnDecode()
Decodes the URI string without parsing it.
public
static urnDecode(mixed $str[, mixed $charset = false ]) : string
Parameters
- $str : mixed
- $charset : mixed = false
Return values
stringurnEncode()
Encodes the URI string without parsing it.
public
static urnEncode(mixed $str[, mixed $charset = 'UTF-8' ]) : string
Parameters
- $str : mixed
- $charset : mixed = 'UTF-8'
Return values
stringwithFragment()
public
withFragment(string $fragment) : UriInterface
Parameters
- $fragment : string
Tags
Return values
UriInterfacewithHost()
public
withHost(string $host) : UriInterface
Parameters
- $host : string
Tags
Return values
UriInterfacewithPath()
public
withPath(string $path) : UriInterface
Parameters
- $path : string
Tags
Return values
UriInterfacewithPort()
public
withPort(int|null $port) : UriInterface
Parameters
- $port : int|null
Tags
Return values
UriInterfacewithQuery()
public
withQuery(string $query) : UriInterface
Parameters
- $query : string
Tags
Return values
UriInterfacewithScheme()
public
withScheme(string $scheme) : UriInterface
Parameters
- $scheme : string
Tags
Return values
UriInterfacewithUserInfo()
public
withUserInfo(string $user[, string|null $password = null ]) : UriInterface
Parameters
- $user : string
- $password : string|null = null