IRI
IRI parser/serialiser/normaliser
- Full name:
\SimplePie\IRI
Properties
scheme
Scheme
iuserinfo
User Information
ihost
ihost
port
Port
ipath
ipath
iquery
iquery
ifragment
ifragment
normalization
Normalization database
Each key is the scheme, each value is an array with each key as the IRI part and value as the default value for that part.
Methods
__toString
Return the entire IRI when you try and read the object as a string
__set
Overload __set() to provide access via properties
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Property name |
$value |
mixed | Property value |
__get
Overload __get() to provide access via properties
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Property name |
__isset
Overload __isset() to provide access via properties
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Property name |
__unset
Overload __unset() to provide access via properties
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Property name |
__construct
Create a new IRI object, from a specified string
Parameters:
Parameter | Type | Description |
---|---|---|
$iri |
string |
__destruct
Clean up
absolutize
Create a new IRI object by resolving a relative IRI
public static absolutize(\SimplePie\IRI|string $base, \SimplePie\IRI|string $relative): \SimplePie\IRI|false
Returns false if $base is not absolute, otherwise an IRI.
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$base |
\SimplePie\IRI|string | (Absolute) Base IRI |
$relative |
\SimplePie\IRI|string | Relative IRI |
parse_iri
Parse an IRI into scheme/authority/path/query/fragment segments
Parameters:
Parameter | Type | Description |
---|---|---|
$iri |
string |
remove_dot_segments
Remove dot segments from a path
Parameters:
Parameter | Type | Description |
---|---|---|
$input |
string |
replace_invalid_with_pct_encoding
Replace invalid character with percent encoding
protected replace_invalid_with_pct_encoding(string $string, string $extra_chars, bool $iprivate = false): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | Input string |
$extra_chars |
string | Valid characters not in iunreserved or iprivate (this is ASCII-only) |
$iprivate |
bool | Allow iprivate |
remove_iunreserved_percent_encoded
Callback function for preg_replace_callback.
Removes sequences of percent encoded bytes that represent UTF-8 encoded characters in iunreserved
Parameters:
Parameter | Type | Description |
---|---|---|
$match |
array | PCRE match |
Return Value:
Replacement
scheme_normalization
is_valid
Check if the object represents a valid IRI. This needs to be done on each call as some things change depending on another part of the IRI.
set_iri
Set the entire IRI. Returns true on success, false on failure (if there are any invalid characters).
Parameters:
Parameter | Type | Description |
---|---|---|
$iri |
string | |
$clear_cache |
mixed |
set_scheme
Set the scheme. Returns true on success, false on failure (if there are any invalid characters).
Parameters:
Parameter | Type | Description |
---|---|---|
$scheme |
string |
set_authority
Set the authority. Returns true on success, false on failure (if there are any invalid characters).
Parameters:
Parameter | Type | Description |
---|---|---|
$authority |
string | |
$clear_cache |
mixed |
set_userinfo
Set the iuserinfo.
Parameters:
Parameter | Type | Description |
---|---|---|
$iuserinfo |
string |
set_host
Set the ihost. Returns true on success, false on failure (if there are any invalid characters).
Parameters:
Parameter | Type | Description |
---|---|---|
$ihost |
string |
set_port
Set the port. Returns true on success, false on failure (if there are any invalid characters).
Parameters:
Parameter | Type | Description |
---|---|---|
$port |
string |
set_path
Set the ipath.
Parameters:
Parameter | Type | Description |
---|---|---|
$ipath |
string | |
$clear_cache |
mixed |
set_query
Set the iquery.
Parameters:
Parameter | Type | Description |
---|---|---|
$iquery |
string |
set_fragment
Set the ifragment.
Parameters:
Parameter | Type | Description |
---|---|---|
$ifragment |
string |
to_uri
Convert an IRI to a URI (or parts thereof)
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
mixed |
get_iri
Get the complete IRI
get_uri
Get the complete URI
get_iauthority
Get the complete iauthority
get_authority
Get the complete authority
Automatically generated on 2025-03-18