PHP Interface Visitor

Mostra file Open project: getkirby/toolkit Interface Usage Examples

Public Properties

Property Type Description
$banned banned ips

Protected Properties

Property Type Description
$acceptedLanguageCode cache for the detected language code

Public Methods

Method Description
acceptance ( string $type ) : float Returns a number between 0 and 1 that defines how "accepted" a specified MIME type is for the visitor's browser using the HTTP Accept header
acceptedLanguage ( ) : string Returns the user's accepted language
acceptedLanguageCode ( ) : string Returns the user's accepted language code
accepts ( string $type ) : boolean Returns whether a specified MIME type is accepted by the visitor's browser
banned ( ) : boolean Checks if the ip of the current visitor is banned
ip ( ) : string Returns the ip address of the current visitor
referer ( ) : string Nobody can remember if it is written with on or two r
referrer ( ) : string Returns the referrer if available
ua ( ) : string Returns the user agent string of the current visitor
userAgent ( ) : string A more readable but longer alternative for ua()

Method Details

acceptance() public static method

Returns a number between 0 and 1 that defines how "accepted" a specified MIME type is for the visitor's browser using the HTTP Accept header
public static acceptance ( string $type ) : float
$type string MIME type like "text/html"
return float Number between 0 (not accepted) and 1 (very accepted)

acceptedLanguage() public static method

Returns the user's accepted language
public static acceptedLanguage ( ) : string
return string

acceptedLanguageCode() public static method

Returns the user's accepted language code
public static acceptedLanguageCode ( ) : string
return string

accepts() public static method

Returns whether a specified MIME type is accepted by the visitor's browser
public static accepts ( string $type ) : boolean
$type string MIME type like "text/html"
return boolean

banned() public static method

Checks if the ip of the current visitor is banned
public static banned ( ) : boolean
return boolean

ip() public static method

Returns the ip address of the current visitor
public static ip ( ) : string
return string

referer() public static method

Nobody can remember if it is written with on or two r
public static referer ( ) : string
return string

referrer() public static method

Returns the referrer if available
public static referrer ( ) : string
return string

ua() public static method

Returns the user agent string of the current visitor
public static ua ( ) : string
return string

userAgent() public static method

A more readable but longer alternative for ua()
public static userAgent ( ) : string
return string

Property Details

$acceptedLanguageCode protected_oe static_oe property

cache for the detected language code
protected static $acceptedLanguageCode

$banned public_oe static_oe property

banned ips
public static $banned