PHP 클래스 Piwik\IP

As of Piwik 1.3, IP addresses are stored in the DB has VARBINARY(16), and passed around in network address format which has the advantage of being in big-endian byte order. This allows for binary-safe string comparison of addresses (of the same length), even on Intel x86. As a matter of naming convention, we use $ip for the network address format and $ipString for the presentation format (i.e., human-readable form). We're not using the network address format (in_addr) for socket functions, so we don't have to worry about incompatibility with Windows UNICODE and inetPtonW().
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
getFirstIpFromList ( string $csv, array $excludedIps = null ) : string Returns the last IP address in a comma separated list, subject to an optional exclusion list.
getIpFromHeader ( ) : string Returns the most accurate IP address available for the current user, in IPv4 format. This could be the proxy client's IP address.
getNonProxyIpFromHeader ( string $default, array $proxyHeaders ) : string Returns a non-proxy IP address from header.

메소드 상세

getFirstIpFromList() 공개 정적인 메소드

Returns the last IP address in a comma separated list, subject to an optional exclusion list.
public static getFirstIpFromList ( string $csv, array $excludedIps = null ) : string
$csv string Comma separated list of elements.
$excludedIps array Optional list of excluded IP addresses (or IP address ranges).
리턴 string Last (non-excluded) IP address in the list or an empty string if all given IPs are excluded.

getIpFromHeader() 공개 정적인 메소드

Returns the most accurate IP address available for the current user, in IPv4 format. This could be the proxy client's IP address.
public static getIpFromHeader ( ) : string
리턴 string IP address in presentation format.

getNonProxyIpFromHeader() 공개 정적인 메소드

Returns a non-proxy IP address from header.
public static getNonProxyIpFromHeader ( string $default, array $proxyHeaders ) : string
$default string Default value to return if there no matching proxy header.
$proxyHeaders array List of proxy headers.
리턴 string