IRI parser/serialiser/normaliser
Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| package | Requests |
|---|---|
| subpackage | Utilities |
| author | Geoffrey Sneddon |
| author | Steve Minutillo |
| copyright | 2007-2009 Geoffrey Sneddon and Steve Minutillo |
| license | http://www.opensource.org/licenses/bsd-license.php |
| link | http://hg.gsnedders.com/iri/ |
__construct(string|null $iri = null)
stringnull
__get(string $name) : mixed
stringProperty name
mixed__isset(string $name) : boolean
stringProperty name
boolean__set(string $name, mixed $value)
stringProperty name
mixedProperty value
__toString() : string
string__unset(string $name)
stringProperty name
absolutize(\IRI|string $base, \IRI|string $relative) : \IRI | false
Returns false if $base is not absolute, otherwise an IRI.
\IRIstring(Absolute) Base IRI
\IRIstringRelative IRI
\IRIfalse
is_valid() : boolean
booleanget_iri() : string
stringget_uri() : string
stringparse_iri(string $iri) : array
string
arrayremove_dot_segments(string $input) : string
string
stringremove_iunreserved_percent_encoded(array $match) : string
Removes sequences of percent encoded bytes that represent UTF-8 encoded characters in iunreserved
arrayPCRE match
stringReplacementreplace_invalid_with_pct_encoding(string $string, string $extra_chars, boolean $iprivate = false) : string
stringInput string
stringValid characters not in iunreserved or iprivate (this is ASCII-only)
booleanAllow iprivate
stringscheme_normalization()
set_fragment(string $ifragment) : boolean
string
booleanset_host(string $ihost) : boolean
string
booleanset_iri(string $iri) : boolean
string
booleanset_path(string $ipath) : boolean
string
booleanset_port(string $port) : boolean
string
booleanset_query(string $iquery) : boolean
string
booleanset_scheme(string $scheme) : boolean
string
booleanset_userinfo(string $iuserinfo) : boolean
string
booleanto_uri(string | boolean $string) : string | false
stringbooleanIRI to convert (or false from {@see get_iri})
stringfalseURI if IRI is valid, false otherwise.$fragment : string
| magic | |
|---|---|
| property | Fragment, formatted for a URI (after '#') |
$host : string
| magic | |
|---|---|
| property | Host part, formatted for a URI |
$ifragment : string
| magic | |
|---|---|
| property | Fragment part of the IRI (after '#') |
$ihost : string
| magic | |
|---|---|
| property | Host part of the IRI |
$ipath : string
| magic | |
|---|---|
| property | Path part of the IRI (after first '/') |
$iquery : string
| magic | |
|---|---|
| property | Query part of the IRI (after '?') |
$iri : string
| magic | |
|---|---|
| property | IRI we're working with |
$iuserinfo : string
| magic | |
|---|---|
| property | Userinfo part of the IRI (after '://' and before '@') |
$path : string
| magic | |
|---|---|
| property | Path part, formatted for a URI (after first '/') |
$port : string
| magic | |
|---|---|
| property | Port part of the IRI (after ':') |
$query : string
| magic | |
|---|---|
| property | Query part, formatted for a URI (after '?') |
$scheme : string
| magic | |
|---|---|
| property | Scheme part of the IRI |
$uri : string
| magic | |
|---|---|
| property-read | IRI in URI form, {@see to_uri} |
$userinfo : string
| magic | |
|---|---|
| property | Userinfo part, formatted for a URI (after '://' and before '@') |
$ifragment : string
null$ihost : string
null$ipath : string
''$iquery : string
null$iuserinfo : string
null$normalization
array('acap' => array('port' => 674), 'dict' => array('port' => 2628), 'file' => array('ihost' => 'localhost'), 'http' => array('port' => 80), 'https' => array('port' => 443))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 : string
null$scheme : string
null