PHP Класс Horde_Nls, horde

This includes common methods for handling language data, timezones, and hostname->country lookups.
Автор: Jon Parise ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Автор: Jan Schneider ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$dnsResolver Net_DNS2_Resolver DNS resolver.

Защищенные свойства (Protected)

Свойство Тип Описание
$_cache array Cached values.

Открытые методы

Метод Описание
checkCharset ( string $charset ) : boolean Check to see if character set is valid for htmlspecialchars() calls.
getCountryByHost ( string $host, string $datafile = null ) : mixed Get country information from a hostname or IP address.
getCountryISO ( string $code = null ) : mixed Returns either a specific or all ISO-3166 country names.
getLangInfo ( const $item ) : array Get the language info returned by nl_langinfo(), but cache it, to avoid repeated calls.
getLanguageISO ( string $code = null ) : mixed Returns either a specific or all ISO-639 language names.
getLocaleInfo ( ) : array Get the locale info returned by localeconv(), but cache it, to avoid repeated calls.
getTimezones ( ) : array Returns a list of available timezones.
getTimezonesWithAbbreviations ( ) : array Returns a list of available timezones, including timezone abbreviations.
tldLookup ( string $code ) : mixed Do a top level domain (TLD) lookup.

Описание методов

checkCharset() публичный статический Метод

Check to see if character set is valid for htmlspecialchars() calls.
public static checkCharset ( string $charset ) : boolean
$charset string The character set to check.
Результат boolean Is charset valid for the current system?

getCountryByHost() публичный статический Метод

Get country information from a hostname or IP address.
public static getCountryByHost ( string $host, string $datafile = null ) : mixed
$host string The hostname or IP address.
$datafile string The datafile for the GeoIP lookup. If not set, will skip this lookup.
Результат mixed On success, return an array with the following entries: 'code' => Country Code 'name' => Country Name On failure, return false.

getCountryISO() публичный статический Метод

Returns either a specific or all ISO-3166 country names.
public static getCountryISO ( string $code = null ) : mixed
$code string The ISO 3166 country code.
Результат mixed If a country code has been requested will return the corresponding country name. If empty will return an array of all the country codes and their names.

getLangInfo() публичный статический Метод

Get the language info returned by nl_langinfo(), but cache it, to avoid repeated calls.
public static getLangInfo ( const $item ) : array
$item const The langinfo item to return.
Результат array The results of nl_langinfo().

getLanguageISO() публичный статический Метод

Returns either a specific or all ISO-639 language names.
public static getLanguageISO ( string $code = null ) : mixed
$code string The ISO 639 language code.
Результат mixed If a language code has been requested will return the corresponding language name. If empty will return an array of all the language codes (keys) and their names (values).

getLocaleInfo() публичный статический Метод

Get the locale info returned by localeconv(), but cache it, to avoid repeated calls.
public static getLocaleInfo ( ) : array
Результат array The results of localeconv().

getTimezones() публичный статический Метод

Returns a list of available timezones.
public static getTimezones ( ) : array
Результат array List of timezones.

getTimezonesWithAbbreviations() публичный статический Метод

Contrary to getTimezones() the timezone IDs are values and the timezone labels are the keys, to allow multiple labels for the same timezone.
С версии: 2.2.0
public static getTimezonesWithAbbreviations ( ) : array
Результат array List of timezones.

tldLookup() публичный статический Метод

Do a top level domain (TLD) lookup.
public static tldLookup ( string $code ) : mixed
$code string A 2-letter country code.
Результат mixed The localized country name, or null if not found.

Описание свойств

$_cache защищенное статическое свойство

Cached values.
protected static array $_cache
Результат array

$dnsResolver публичное статическое свойство

DNS resolver.
public static Net_DNS2_Resolver $dnsResolver
Результат Net_DNS2_Resolver