Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • Net_IDNA2
  • Overview
  • Package
  • Class
  • Tree

Class Net_IDNA2

Encode/decode Internationalized Domain Names.

The class allows to convert internationalized domain names (see RFC 3490 for details) as they can be used with various registries worldwide to be translated between their original (localized) form and their encoded form as it will be used in the DNS (Domain Name System).

The class provides two public methods, encode() and decode(), which do exactly what you would expect them to do. You are allowed to use complete domain names, simple strings and complete email addresses as well. That means, that you might use any of the following notations:

  • www.n�rgler.com
  • xn--nrgler-wxa
  • xn--brse-5qa.xn--knrz-1ra.info

Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4 array. Unicode output is available in the same formats. You can select your preferred format via set_paramter().

ACE input and output is always expected to be ASCII.

Package: Net
Author: Markus Nix <mnix@docuverse.de>
Author: Matthias Sommerfeld <mso@phlylabs.de>
Author: Stefan Neufeind <pear.neufeind@speedpartner.de>
Version: $Id: IDNA2.php 305344 2010-11-14 23:52:42Z neufeind $
Located at x2engine/framework/vendors/Net_IDNA2/Net/IDNA2.php
Methods summary
public
# __construct( array $options = null )

Constructor

Constructor

Parameters

$options
array
$options Options to initialise the object with

See

Net_IDNA2::setParams()
public boolean
# setParams( mixed $option, string $value = false )

Sets a new option value. Available options and values:

Sets a new option value. Available options and values:

[utf8 - Use either UTF-8 or ISO-8859-1 as input (true for UTF-8, false otherwise); The output is always UTF-8] [overlong - Unicode does not allow unnecessarily long encodings of chars, to allow this, set this parameter to true, else to false; default is false.] [strict - true: strict mode, good for registration purposes - Causes errors on failures; false: loose mode, ideal for "wildlife" applications by silently ignoring errors and returning the original input instead]

Parameters

$option
mixed
$option Parameter to set (string: single parameter; array of Parameter => Value pairs)
$value
string
$value Value to use (if parameter 1 is a string)

Returns

boolean
true on success, false otherwise
public string
# encode( string $decoded, string $one_time_encoding = false )

Encode a given UTF-8 domain name.

Encode a given UTF-8 domain name.

Parameters

$decoded
string
$decoded Domain name (UTF-8 or UCS-4)
$one_time_encoding
string
$one_time_encoding Desired input encoding, see set_parameter If not given will use default-encoding

Returns

string
Encoded Domain name (ACE string)
mixed
processed string

Throws

Exception
public string
# decode( string $input, string $one_time_encoding = false )

Decode a given ACE domain name.

Decode a given ACE domain name.

Parameters

$input
string
$input Domain name (ACE string)
$one_time_encoding
string
$one_time_encoding Desired output encoding, see set_parameter

Returns

string
Decoded Domain name (UTF-8 or UCS-4)

Throws

Exception
public Net_IDNA2
# getInstance( array $params = array() )

Attempts to return a concrete IDNA instance for either php4 or php5.

Attempts to return a concrete IDNA instance for either php4 or php5.

Parameters

$params
array
$params Set of paramaters

Returns

Net_IDNA2
public object
# singleton( array $params = array() )

Attempts to return a concrete IDNA instance for either php4 or php5, only creating a new instance if no IDNA instance with the same parameters currently exists.

Attempts to return a concrete IDNA instance for either php4 or php5, only creating a new instance if no IDNA instance with the same parameters currently exists.

Parameters

$params
array
$params Set of paramaters

Returns

object
Net_IDNA2
API documentation generated by ApiGen 2.8.0