PHP 클래스 CI_User_agent, TastyIgniter

Identifies the platform, browser, robot, or mobile devise of the browsing agent
저자: EllisLab Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$agent string Current user-agent
$browser string Current user-agent browser
$browsers array List of browsers to compare against current user agent
$charsets array Character sets accepted by the current user agent
$is_browser boolean Flag for if the user-agent belongs to a browser
$is_mobile boolean Flag for if the user-agent is a mobile browser
$is_robot boolean Flag for if the user-agent is a robot
$languages array Languages accepted by the current user agent
$mobile string Current user-agent mobile name
$mobiles array List of mobile browsers to compare against current user agent
$platform string Current user-agent platform
$platforms array List of platforms to compare against current user agent
$referer mixed HTTP Referer
$robot string Current user-agent robot name
$robots array List of robots to compare against current user agent
$version string Current user-agent version

공개 메소드들

메소드 설명
__construct ( ) : void Constructor
accept_charset ( string $charset = 'utf-8' ) : boolean Test for a particular character set
accept_lang ( string $lang = 'en' ) : boolean Test for a particular language
agent_string ( ) : string Agent String
browser ( ) : string Get Browser Name
charsets ( ) : array Get the accepted Character Sets
is_browser ( string $key = NULL ) : boolean Is Browser
is_mobile ( string $key = NULL ) : boolean Is Mobile
is_referral ( ) : boolean Is this a referral from another site?
is_robot ( string $key = NULL ) : boolean Is Robot
languages ( ) : array Get the accepted languages
mobile ( ) : string Get the Mobile Device
parse ( string $string ) : void Parse a custom user-agent string
platform ( ) : string Get Platform
referrer ( ) : boolean Get the referrer
robot ( ) : string Get The Robot Name
version ( ) : string Get the Browser Version

보호된 메소드들

메소드 설명
_compile_data ( ) : boolean Compile the User Agent Data
_load_agent_file ( ) : boolean Compile the User Agent Data
_set_browser ( ) : boolean Set the Browser
_set_charsets ( ) : void Set the accepted character sets
_set_languages ( ) : void Set the accepted languages
_set_mobile ( ) : boolean Set the Mobile Device
_set_platform ( ) : boolean Set the Platform
_set_robot ( ) : boolean Set the Robot

메소드 상세

__construct() 공개 메소드

Sets the User Agent and runs the compilation routine
public __construct ( ) : void
리턴 void

_compile_data() 보호된 메소드

Compile the User Agent Data
protected _compile_data ( ) : boolean
리턴 boolean

_load_agent_file() 보호된 메소드

Compile the User Agent Data
protected _load_agent_file ( ) : boolean
리턴 boolean

_set_browser() 보호된 메소드

Set the Browser
protected _set_browser ( ) : boolean
리턴 boolean

_set_charsets() 보호된 메소드

Set the accepted character sets
protected _set_charsets ( ) : void
리턴 void

_set_languages() 보호된 메소드

Set the accepted languages
protected _set_languages ( ) : void
리턴 void

_set_mobile() 보호된 메소드

Set the Mobile Device
protected _set_mobile ( ) : boolean
리턴 boolean

_set_platform() 보호된 메소드

Set the Platform
protected _set_platform ( ) : boolean
리턴 boolean

_set_robot() 보호된 메소드

Set the Robot
protected _set_robot ( ) : boolean
리턴 boolean

accept_charset() 공개 메소드

Test for a particular character set
public accept_charset ( string $charset = 'utf-8' ) : boolean
$charset string
리턴 boolean

accept_lang() 공개 메소드

Test for a particular language
public accept_lang ( string $lang = 'en' ) : boolean
$lang string
리턴 boolean

agent_string() 공개 메소드

Agent String
public agent_string ( ) : string
리턴 string

browser() 공개 메소드

Get Browser Name
public browser ( ) : string
리턴 string

charsets() 공개 메소드

Get the accepted Character Sets
public charsets ( ) : array
리턴 array

is_browser() 공개 메소드

Is Browser
public is_browser ( string $key = NULL ) : boolean
$key string
리턴 boolean

is_mobile() 공개 메소드

Is Mobile
public is_mobile ( string $key = NULL ) : boolean
$key string
리턴 boolean

is_referral() 공개 메소드

Is this a referral from another site?
public is_referral ( ) : boolean
리턴 boolean

is_robot() 공개 메소드

Is Robot
public is_robot ( string $key = NULL ) : boolean
$key string
리턴 boolean

languages() 공개 메소드

Get the accepted languages
public languages ( ) : array
리턴 array

mobile() 공개 메소드

Get the Mobile Device
public mobile ( ) : string
리턴 string

parse() 공개 메소드

Parse a custom user-agent string
public parse ( string $string ) : void
$string string
리턴 void

platform() 공개 메소드

Get Platform
public platform ( ) : string
리턴 string

referrer() 공개 메소드

Get the referrer
public referrer ( ) : boolean
리턴 boolean

robot() 공개 메소드

Get The Robot Name
public robot ( ) : string
리턴 string

version() 공개 메소드

Get the Browser Version
public version ( ) : string
리턴 string

프로퍼티 상세

$agent 공개적으로 프로퍼티

Current user-agent
public string $agent
리턴 string

$browser 공개적으로 프로퍼티

Current user-agent browser
public string $browser
리턴 string

$browsers 공개적으로 프로퍼티

List of browsers to compare against current user agent
public array $browsers
리턴 array

$charsets 공개적으로 프로퍼티

Character sets accepted by the current user agent
public array $charsets
리턴 array

$is_browser 공개적으로 프로퍼티

Flag for if the user-agent belongs to a browser
public bool $is_browser
리턴 boolean

$is_mobile 공개적으로 프로퍼티

Flag for if the user-agent is a mobile browser
public bool $is_mobile
리턴 boolean

$is_robot 공개적으로 프로퍼티

Flag for if the user-agent is a robot
public bool $is_robot
리턴 boolean

$languages 공개적으로 프로퍼티

Languages accepted by the current user agent
public array $languages
리턴 array

$mobile 공개적으로 프로퍼티

Current user-agent mobile name
public string $mobile
리턴 string

$mobiles 공개적으로 프로퍼티

List of mobile browsers to compare against current user agent
public array $mobiles
리턴 array

$platform 공개적으로 프로퍼티

Current user-agent platform
public string $platform
리턴 string

$platforms 공개적으로 프로퍼티

List of platforms to compare against current user agent
public array $platforms
리턴 array

$referer 공개적으로 프로퍼티

HTTP Referer
public mixed $referer
리턴 mixed

$robot 공개적으로 프로퍼티

Current user-agent robot name
public string $robot
리턴 string

$robots 공개적으로 프로퍼티

List of robots to compare against current user agent
public array $robots
리턴 array

$version 공개적으로 프로퍼티

Current user-agent version
public string $version
리턴 string