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
)
string
null
__get(string $name) : mixed
string
Property name
mixed
__isset(string $name) : boolean
string
Property name
boolean
__set(string $name, mixed $value)
string
Property name
mixed
Property value
__toString() : string
string
__unset(string $name)
string
Property name
absolutize(\IRI|string $base, \IRI|string $relative) : \IRI | false
Returns false if $base is not absolute, otherwise an IRI.
\IRI
string
(Absolute) Base IRI
\IRI
string
Relative IRI
\IRI
false
is_valid() : boolean
boolean
get_iri() : string
string
get_uri() : string
string
parse_iri(string $iri) : array
string
array
remove_dot_segments(string $input) : string
string
string
remove_iunreserved_percent_encoded(array $match) : string
Removes sequences of percent encoded bytes that represent UTF-8 encoded characters in iunreserved
array
PCRE match
string
Replacementreplace_invalid_with_pct_encoding(string $string, string $extra_chars, boolean $iprivate = false
) : string
string
Input string
string
Valid characters not in iunreserved or iprivate (this is ASCII-only)
boolean
Allow iprivate
string
scheme_normalization()
set_fragment(string $ifragment) : boolean
string
boolean
set_host(string $ihost) : boolean
string
boolean
set_iri(string $iri) : boolean
string
boolean
set_path(string $ipath) : boolean
string
boolean
set_port(string $port) : boolean
string
boolean
set_query(string $iquery) : boolean
string
boolean
set_scheme(string $scheme) : boolean
string
boolean
set_userinfo(string $iuserinfo) : boolean
string
boolean
to_uri(string | boolean $string) : string | false
string
boolean
IRI to convert (or false from {@see get_iri})
string
false
URI 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