SimplePie: PHP-based RSS and Atom feed handling
 
  • Overview
  • Demo
  • Blog
  • Download
  • Documentation
  • API Docs
  • Support
  • Issue Tracker
  • FAQ
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • SimplePie
    • API
    • Caching
    • HTTP
    • Parsing

Classes

  • SimplePie_Content_Type_Sniffer
  • SimplePie_File
  • SimplePie_gzdecode
  • SimplePie_HTTP_Parser
  • SimplePie_IRI
  • SimplePie_Net_IPv6

Class SimplePie_IRI

IRI parser/serialiser/normaliser

Package: SimplePie\HTTP
Copyright: 2007-2012 Geoffrey Sneddon, Steve Minutillo, Ryan McCue
License: http://www.opensource.org/licenses/bsd-license.php
Author: Geoffrey Sneddon
Author: Steve Minutillo
Author: Ryan McCue
Located at SimplePie/IRI.php
Methods summary
public string
# __toString( )

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

Parameters

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

Overload __get() to provide access via properties

Parameters

$name
string
Property name

Returns

mixed
public boolean
# __isset( string $name )

Overload __isset() to provide access via properties

Parameters

$name
string
Property name

Returns

boolean
public
# __unset( string $name )

Overload __unset() to provide access via properties

Parameters

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

Create a new IRI object, from a specified string

Parameters

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

Create a new IRI object by resolving a relative IRI

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

Parameters

$base
IRI|string
(Absolute) Base IRI
$relative
IRI|string
Relative IRI

Returns

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

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

Parameters

$iri
string

Returns

array
protected string
# remove_dot_segments( string $input )

Remove dot segments from a path

Parameters

$input
string

Returns

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

Replace invalid character with percent encoding

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
protected string
# remove_iunreserved_percent_encoded( array $match )

Callback function for preg_replace_callback.

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

Parameters

$match
array
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.

Returns

boolean
public boolean
# set_iri( string $iri )

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

Parameters

$iri
string

Returns

boolean
public boolean
# set_scheme( string $scheme )

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

Parameters

$scheme
string

Returns

boolean
public boolean
# set_authority( string $authority )

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

Parameters

$authority
string

Returns

boolean
public boolean
# set_userinfo( string $iuserinfo )

Set the iuserinfo.

Parameters

$iuserinfo
string

Returns

boolean
public boolean
# set_host( string $ihost )

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

Parameters

$ihost
string

Returns

boolean
public boolean
# set_port( string $port )

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

Parameters

$port
string

Returns

boolean
public boolean
# set_path( string $ipath )

Set the ipath.

Parameters

$ipath
string

Returns

boolean
public boolean
# set_query( string $iquery )

Set the iquery.

Parameters

$iquery
string

Returns

boolean
public boolean
# set_fragment( string $ifragment )

Set the ifragment.

Parameters

$ifragment
string

Returns

boolean
public string
# to_uri( $string )

Convert an IRI to a URI (or parts thereof)

Returns

string
public string
# get_iri( )

Get the complete IRI

Returns

string
public string
# get_uri( )

Get the complete URI

Returns

string
protected string
# get_iauthority( )

Get the complete iauthority

Returns

string
protected string
# get_authority( )

Get the complete authority

Returns

string
Properties summary
protected string $scheme null
#

Scheme

protected string $iuserinfo null
#

User Information

protected string $ihost null
#

ihost

protected string $port null
#

Port

protected string $ipath ''
#

ipath

protected string $iquery null
#

iquery

protected string $ifragment null
#

ifragment

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

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.

Show some love! Wishlists for Geoffrey, Ryan P., and Ryan M.

SimplePie is © 2004–2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue and contributors. Licensed under the BSD License. Hosted thanks to Matt Mullenweg, API documentation generated by ApiGen 2.6.1. Variation on the Feed Icon by Wolfgang Bartelme.