API - XOOPS 2.5.11 Beta 2
By monxoops.fr
RegisteredDomain Class Reference

Public Member Functions

 __construct (PublicSuffixList $psl=null)
 
 getRegisteredDomain ($host)
 

Protected Member Functions

 normalizeHost ($url)
 
 convertPunycode ($part)
 
 decodePunycode ($encoded)
 
 findRegisteredDomain ($remainingSigningDomainParts, &$treeNode)
 

Protected Attributes

 $tree
 
 $psl
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( PublicSuffixList  $psl = null)

RegisteredDomain constructor.

Parameters
PublicSuffixList | null$pslPublicSuffixList object, or null to use defaults

Member Function Documentation

◆ convertPunycode()

convertPunycode (   $part)
protected

Convert a punycode string to UTF-8 if needed

Parameters
string$parthost component
Returns
string host component as UTF-8
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodePunycode()

decodePunycode (   $encoded)
protected

convert punycode to UTF-8 (the hard way) Used only if idn_to_utf8() is not available

This fallback adapted from https://ckon.wordpress.com/2010/08/24/punycode-to-unicode-converter-php/

Parameters
string$encoded
Returns
string
Here is the caller graph for this function:

◆ findRegisteredDomain()

findRegisteredDomain (   $remainingSigningDomainParts,
$treeNode 
)
protected

Recursive helper method to query the PSL tree

Parameters
string[]$remainingSigningDomainPartsparts of domain being queried
string[]$treeNodesubset of tree array by reference
Returns
null|string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRegisteredDomain()

getRegisteredDomain (   $host)

Determine the registered domain portion of the supplied host string

Parameters
string$hosta host name or URL containing a host name
Returns
string|null shortest registrable domain portion of the supplied host or null if invalid
Here is the call graph for this function:

◆ normalizeHost()

normalizeHost (   $url)
protected

Given a URL or bare host name, return a normalized host name, converting punycode to UTF-8 and converting to lower case

Parameters
string$urlURL or host name
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $psl

$psl
protected

◆ $tree

$tree
protected

The documentation for this class was generated from the following file: