Properties

$agent

$agent : string

Current user-agent

Type

string

$isBrowser

$isBrowser : boolean

Flag for if the user-agent belongs to a browser

Type

boolean

$isRobot

$isRobot : boolean

Flag for if the user-agent is a robot

Type

boolean

$isMobile

$isMobile : boolean

Flag for if the user-agent is a mobile browser

Type

boolean

$config

$config : \Config\UserAgents

Holds the config file contents.

Type

\Config\UserAgents

$platform

$platform : string

Current user-agent platform

Type

string

$browser

$browser : string

Current user-agent browser

Type

string

$version

$version : string

Current user-agent version

Type

string

$mobile

$mobile : string

Current user-agent mobile name

Type

string

$robot

$robot : string

Current user-agent robot name

Type

string

$referrer

$referrer : mixed

HTTP Referer

Type

mixed

Methods

__construct()

__construct(null  $config = null) 

Constructor

Sets the User Agent and runs the compilation routine

Parameters

null $config

isBrowser()

isBrowser(string  $key = null) : boolean

Is Browser

Parameters

string $key

Returns

boolean

isRobot()

isRobot(string  $key = null) : boolean

Is Robot

Parameters

string $key

Returns

boolean

isMobile()

isMobile(string  $key = null) : boolean

Is Mobile

Parameters

string $key

Returns

boolean

isReferral()

isReferral() : boolean

Is this a referral from another site?

Returns

boolean

getAgentString()

getAgentString() : string

Agent String

Returns

string

getPlatform()

getPlatform() : string

Get Platform

Returns

string

getBrowser()

getBrowser() : string

Get Browser Name

Returns

string

getVersion()

getVersion() : string

Get the Browser Version

Returns

string

getRobot()

getRobot() : string

Get The Robot Name

Returns

string

getMobile()

getMobile() : string

Get the Mobile Device

Returns

string

getReferrer()

getReferrer() : string

Get the referrer

Returns

string

parse()

parse(string  $string) : void

Parse a custom user-agent string

Parameters

string $string

__toString()

__toString() : string

Outputs the original Agent String when cast as a string.

Returns

string

compileData()

compileData() : void

Compile the User Agent Data

setPlatform()

setPlatform() : boolean

Set the Platform

Returns

boolean

setBrowser()

setBrowser() : boolean

Set the Browser

Returns

boolean

setRobot()

setRobot() : boolean

Set the Robot

Returns

boolean

setMobile()

setMobile() : boolean

Set the Mobile Device

Returns

boolean