IRI parser/serialiser/normaliser

package SimplePie
subpackage HTTP
author Geoffrey Sneddon
author Steve Minutillo
author Ryan McCue
copyright 2007-2012 Geoffrey Sneddon, Steve Minutillo, Ryan McCue
license http://www.opensource.org/licenses/bsd-license.php

 Methods

Create a new IRI object, from a specified string

__construct(string $iri = null

Parameters

$iri

string

Overload __get() to provide access via properties

__get(string $name) : mixed

Parameters

$name

string

Property name

Returns

mixed

Overload __isset() to provide access via properties

__isset(string $name) : boolean

Parameters

$name

string

Property name

Returns

boolean

Overload __set() to provide access via properties

__set(string $name, mixed $value) 

Parameters

$name

string

Property name

$value

mixed

Property value

Return the entire IRI when you try and read the object as a string

__toString() : string

Returns

string

Overload __unset() to provide access via properties

__unset(string $name) 

Parameters

$name

string

Property name

Create a new IRI object by resolving a relative IRI

absolutize(\IRI|string $base, \IRI|string $relative) : \IRI | false
Static

Returns false if $base is not absolute, otherwise an IRI.

Parameters

$base

\IRIstring

(Absolute) Base IRI

$relative

\IRIstring

Relative IRI

Returns

\IRIfalse

Get the complete IRI

get_iri() : string

Returns

string

Get the complete URI

get_uri() : string

Returns

string

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.

is_valid() : boolean

Returns

boolean

Set the authority. Returns true on success, false on failure (if there are any invalid characters).

set_authority(string $authority) : boolean

Parameters

$authority

string

Returns

boolean

Set the ifragment.

set_fragment(string $ifragment) : boolean

Parameters

$ifragment

string

Returns

boolean

Set the ihost. Returns true on success, false on failure (if there are any invalid characters).

set_host(string $ihost) : boolean

Parameters

$ihost

string

Returns

boolean

Set the entire IRI. Returns true on success, false on failure (if there are any invalid characters).

set_iri(string $iri) : boolean

Parameters

$iri

string

Returns

boolean

Set the ipath.

set_path(string $ipath) : boolean

Parameters

$ipath

string

Returns

boolean

Set the port. Returns true on success, false on failure (if there are any invalid characters).

set_port(string $port) : boolean

Parameters

$port

string

Returns

boolean

Set the iquery.

set_query(string $iquery) : boolean

Parameters

$iquery

string

Returns

boolean

Set the scheme. Returns true on success, false on failure (if there are any invalid characters).

set_scheme(string $scheme) : boolean

Parameters

$scheme

string

Returns

boolean

Set the iuserinfo.

set_userinfo(string $iuserinfo) : boolean

Parameters

$iuserinfo

string

Returns

boolean

Convert an IRI to a URI (or parts thereof)

to_uri($string) : string

Parameters

$string

Returns

string

Get the complete authority

get_authority() : string

Returns

string

Get the complete iauthority

get_iauthority() : string

Returns

string

Parse an IRI into scheme/authority/path/query/fragment segments

parse_iri(string $iri) : array

Parameters

$iri

string

Returns

array

Remove dot segments from a path

remove_dot_segments(string $input) : string

Parameters

$input

string

Returns

string

Callback function for preg_replace_callback.

remove_iunreserved_percent_encoded(array $match) : string

Removes sequences of percent encoded bytes that represent UTF-8 encoded characters in iunreserved

Parameters

$match

array

PCRE match

Returns

stringReplacement

Replace invalid character with percent encoding

replace_invalid_with_pct_encoding(string $string, string $extra_chars, boolean $iprivate = false) : string

Parameters

$string

string

Input string

$extra_chars

string

Valid characters not in iunreserved or iprivate (this is ASCII-only)

$iprivate

boolean

Allow iprivate

Returns

string

scheme_normalization()

scheme_normalization() 

 Properties

 

ifragment

$ifragment : string

Default

null
 

ihost

$ihost : string

Default

null
 

ipath

$ipath : string

Default

''
 

iquery

$iquery : string

Default

null
 

User Information

$iuserinfo : string

Default

null
 

Normalization database

$normalization 

Default

array('acap' => array('port' => 674), 'dict' => array('port' => 2628), 'file' => array('ihost' => 'localhost'), 'http' => array('port' => 80, 'ipath' => '/'), 'https' => array('port' => 443, 'ipath' => '/'))

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.

 

Port

$port : string

Default

null
 

Scheme

$scheme : string

Default

null