Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests_Hooks
  • Requests_IDNAEncoder
  • Requests_IPv6
  • Requests_IRI
  • Requests_SSL
  • Requests_Utility_CaseInsensitiveDictionary
  • Requests_Utility_FilteredIterator

Interfaces

  • Requests_Hooker
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Warning! You are currently reading the documentation for Requests 1.x.

It is recommended to upgrade to Requests 2.x at your earliest convenience. Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.

Visit the documentation for Requests_IRI in Requests 2.x.

Class Requests_IRI

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. * Neither the name of the SimplePie Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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\Utilities
Copyright: 2007-2009 Geoffrey Sneddon and Steve Minutillo
License: http://www.opensource.org/licenses/bsd-license.php
Author: Geoffrey Sneddon
Author: Steve Minutillo
Link: http://hg.gsnedders.com/iri/
Located at Requests/IRI.php
Methods summary
public string
# __toString( )

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

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

Returns

string
public
# __set( string $name, mixed $value )

Overload __set() to provide access via properties

Overload __set() to provide access via properties

Parameters

$name
Property name
$value
Property value
public mixed
# __get( string $name )

Overload __get() to provide access via properties

Overload __get() to provide access via properties

Parameters

$name
Property name

Returns

mixed
public boolean
# __isset( string $name )

Overload __isset() to provide access via properties

Overload __isset() to provide access via properties

Parameters

$name
Property name

Returns

boolean
public
# __unset( string $name )

Overload __unset() to provide access via properties

Overload __unset() to provide access via properties

Parameters

$name
Property name
public
# __construct( string|null $iri = null )

Create a new IRI object, from a specified string

Create a new IRI object, from a specified string

Parameters

$iri
public static Requests_IRI|false
# absolutize( Requests_IRI|string $base, Requests_IRI|string $relative )

Create a new IRI object by resolving a relative IRI

Create a new IRI object by resolving a relative IRI

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

Parameters

$base
(Absolute) Base IRI
$relative
Relative IRI

Returns

Requests_IRI|false
protected array
# parse_iri( string $iri )

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

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

Parameters

$iri

Returns

array
protected string
# remove_dot_segments( string $input )

Remove dot segments from a path

Remove dot segments from a path

Parameters

$input

Returns

string
protected string
# replace_invalid_with_pct_encoding( string $string, string $extra_chars, boolean $iprivate = false )

Replace invalid character with percent encoding

Replace invalid character with percent encoding

Parameters

$string
Input string
$extra_chars

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

$iprivate
Allow iprivate

Returns

string
protected string
# remove_iunreserved_percent_encoded( array $match )

Callback function for preg_replace_callback.

Callback function for preg_replace_callback.

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

Parameters

$match
PCRE match

Returns

string
Replacement
protected
# scheme_normalization( )
public boolean
# 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.

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.

Returns

boolean
protected boolean
# set_iri( string $iri )

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

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

Parameters

$iri

Returns

boolean
protected boolean
# set_scheme( string $scheme )

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

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

Parameters

$scheme

Returns

boolean
protected boolean
# set_authority( string $authority )

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

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

Parameters

$authority

Returns

boolean
protected boolean
# set_userinfo( string $iuserinfo )

Set the iuserinfo.

Set the iuserinfo.

Parameters

$iuserinfo

Returns

boolean
protected boolean
# set_host( string $ihost )

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

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

Parameters

$ihost

Returns

boolean
protected boolean
# set_port( string $port )

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

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

Parameters

$port

Returns

boolean
protected boolean
# set_path( string $ipath )

Set the ipath.

Set the ipath.

Parameters

$ipath

Returns

boolean
protected boolean
# set_query( string $iquery )

Set the iquery.

Set the iquery.

Parameters

$iquery

Returns

boolean
protected boolean
# set_fragment( string $ifragment )

Set the ifragment.

Set the ifragment.

Parameters

$ifragment

Returns

boolean
protected string|false
# to_uri( string|boolean $string )

Convert an IRI to a URI (or parts thereof)

Convert an IRI to a URI (or parts thereof)

Parameters

$string
to convert (or false from Requests_IRI::get_iri())

Returns

string|false
URI if IRI is valid, false otherwise.
protected string|false
# get_iri( )

Get the complete IRI

Get the complete IRI

Returns

string|false
protected string
# get_uri( )

Get the complete URI

Get the complete URI

Returns

string
protected string|null
# get_iauthority( )

Get the complete iauthority

Get the complete iauthority

Returns

string|null
protected string
# get_authority( )

Get the complete authority

Get the complete authority

Returns

string
Properties summary
protected string|null $scheme

Scheme

Scheme

# null
protected string|null $iuserinfo

User Information

User Information

# null
protected string|null $ihost

ihost

ihost

# null
protected string|null $port

Port

Port

# null
protected string $ipath

ipath

ipath

# ''
protected string|null $iquery

iquery

iquery

# null
protected string $ifragment

ifragment|null

ifragment|null

# null
protected array $normalization

Normalization database

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.

# array( 'acap' => array( 'port' => 674 ), 'dict' => array( 'port' => 2628 ), 'file' => array( 'ihost' => 'localhost' ), 'http' => array( 'port' => 80, ), 'https' => array( 'port' => 443, ), )
Magic properties summary
public string $iri

IRI we're working with

public string $scheme

Scheme part of the IRI

public string $authority

Authority part, formatted for a URI (userinfo + host + port)

public string $iauthority

Authority part of the IRI (userinfo + host + port)

public string $userinfo

Userinfo part, formatted for a URI (after '://' and before '@')

public string $iuserinfo

Userinfo part of the IRI (after '://' and before '@')

public string $host

Host part, formatted for a URI

public string $ihost

Host part of the IRI

public string $port

Port part of the IRI (after ':')

public string $path

Path part, formatted for a URI (after first '/')

public string $ipath

Path part of the IRI (after first '/')

public string $query

Query part, formatted for a URI (after '?')

public string $iquery

Query part of the IRI (after '?')

public string $fragment

Fragment, formatted for a URI (after '#')

public string $ifragment

Fragment part of the IRI (after '#')

public read-only string $uri

IRI in URI form, Requests_IRI::to_uri()

Requests 1.8.1 API Documentation API documentation generated by ApiGen