\Browser

Modified to remove var Chris Christoff on 12/26/2012 Changes: Changes vars to publics

Modified to work for EDD by Chris Christoff on 12/23/2012 Changes: Removed the browser string return and added spacing. Also removed return HTML formatting.

Modified to add formatted User Agent string for EDD System Info by Chris Christoff on 12/23/2012 Changes: Split user string and add formatting so we can print a nicely formatted user agent string on the EDD System Info

File: Browser.php Author: Chris Schuld (http://chrisschuld.com/) Last Modified: August 20th, 2010

Summary

Methods
Properties
Constants
__construct()
reset()
isBrowser()
getBrowser()
setBrowser()
getPlatform()
setPlatform()
getVersion()
setVersion()
getAolVersion()
setAolVersion()
isAol()
isMobile()
isRobot()
setAol()
setMobile()
setRobot()
getUserAgent()
setUserAgent()
isChromeFrame()
__toString()
determine()
checkBrowsers()
checkBrowserBlackBerry()
checkForAol()
checkBrowserGoogleBot()
checkBrowserMSNBot()
checkBrowserW3CValidator()
checkBrowserSlurp()
checkBrowserInternetExplorer()
checkBrowserOpera()
checkBrowserChrome()
checkBrowserWebTv()
checkBrowserNetPositive()
checkBrowserGaleon()
checkBrowserKonqueror()
checkBrowserIcab()
checkBrowserOmniWeb()
checkBrowserPhoenix()
checkBrowserFirebird()
checkBrowserNetscapeNavigator9Plus()
checkBrowserShiretoko()
checkBrowserIceCat()
checkBrowserNokia()
checkBrowserFirefox()
checkBrowserIceweasel()
checkBrowserMozilla()
checkBrowserLynx()
checkBrowserAmaya()
checkBrowserSafari()
checkBrowseriPhone()
checkBrowseriPad()
checkBrowseriPod()
checkBrowserAndroid()
checkPlatform()
$_agent
$_browser_name
$_version
$_platform
$_os
$_is_aol
$_is_mobile
$_is_robot
$_aol_version
$BROWSER_UNKNOWN
$VERSION_UNKNOWN
$BROWSER_OPERA
$BROWSER_OPERA_MINI
$BROWSER_WEBTV
$BROWSER_IE
$BROWSER_POCKET_IE
$BROWSER_KONQUEROR
$BROWSER_ICAB
$BROWSER_OMNIWEB
$BROWSER_FIREBIRD
$BROWSER_FIREFOX
$BROWSER_ICEWEASEL
$BROWSER_SHIRETOKO
$BROWSER_MOZILLA
$BROWSER_AMAYA
$BROWSER_LYNX
$BROWSER_SAFARI
$BROWSER_IPHONE
$BROWSER_IPOD
$BROWSER_IPAD
$BROWSER_CHROME
$BROWSER_ANDROID
$BROWSER_GOOGLEBOT
$BROWSER_SLURP
$BROWSER_W3CVALIDATOR
$BROWSER_BLACKBERRY
$BROWSER_ICECAT
$BROWSER_NOKIA_S60
$BROWSER_NOKIA
$BROWSER_MSN
$BROWSER_MSNBOT
$BROWSER_NETSCAPE_NAVIGATOR
$BROWSER_GALEON
$BROWSER_NETPOSITIVE
$BROWSER_PHOENIX
$PLATFORM_UNKNOWN
$PLATFORM_WINDOWS
$PLATFORM_WINDOWS_CE
$PLATFORM_APPLE
$PLATFORM_LINUX
$PLATFORM_OS2
$PLATFORM_BEOS
$PLATFORM_IPHONE
$PLATFORM_IPOD
$PLATFORM_IPAD
$PLATFORM_BLACKBERRY
$PLATFORM_NOKIA
$PLATFORM_FREEBSD
$PLATFORM_OPENBSD
$PLATFORM_NETBSD
$PLATFORM_SUNOS
$PLATFORM_OPENSOLARIS
$PLATFORM_ANDROID
$OPERATING_SYSTEM_UNKNOWN
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_agent

$_agent : 

Type

$_browser_name

$_browser_name : 

Type

$_version

$_version : 

Type

$_platform

$_platform : 

Type

$_os

$_os : 

Type

$_is_aol

$_is_aol : 

Type

$_is_mobile

$_is_mobile : 

Type

$_is_robot

$_is_robot : 

Type

$_aol_version

$_aol_version : 

Type

$BROWSER_UNKNOWN

$BROWSER_UNKNOWN : 

Type

$VERSION_UNKNOWN

$VERSION_UNKNOWN : 

Type

$BROWSER_OPERA

$BROWSER_OPERA : 

Type

$BROWSER_OPERA_MINI

$BROWSER_OPERA_MINI : 

Type

$BROWSER_WEBTV

$BROWSER_WEBTV : 

Type

$BROWSER_IE

$BROWSER_IE : 

Type

$BROWSER_POCKET_IE

$BROWSER_POCKET_IE : 

Type

$BROWSER_KONQUEROR

$BROWSER_KONQUEROR : 

Type

$BROWSER_ICAB

$BROWSER_ICAB : 

Type

$BROWSER_OMNIWEB

$BROWSER_OMNIWEB : 

Type

$BROWSER_FIREBIRD

$BROWSER_FIREBIRD : 

Type

$BROWSER_FIREFOX

$BROWSER_FIREFOX : 

Type

$BROWSER_ICEWEASEL

$BROWSER_ICEWEASEL : 

Type

$BROWSER_SHIRETOKO

$BROWSER_SHIRETOKO : 

Type

$BROWSER_MOZILLA

$BROWSER_MOZILLA : 

Type

$BROWSER_AMAYA

$BROWSER_AMAYA : 

Type

$BROWSER_LYNX

$BROWSER_LYNX : 

Type

$BROWSER_SAFARI

$BROWSER_SAFARI : 

Type

$BROWSER_IPHONE

$BROWSER_IPHONE : 

Type

$BROWSER_IPOD

$BROWSER_IPOD : 

Type

$BROWSER_IPAD

$BROWSER_IPAD : 

Type

$BROWSER_CHROME

$BROWSER_CHROME : 

Type

$BROWSER_ANDROID

$BROWSER_ANDROID : 

Type

$BROWSER_GOOGLEBOT

$BROWSER_GOOGLEBOT : 

Type

$BROWSER_SLURP

$BROWSER_SLURP : 

Type

$BROWSER_W3CVALIDATOR

$BROWSER_W3CVALIDATOR : 

Type

$BROWSER_BLACKBERRY

$BROWSER_BLACKBERRY : 

Type

$BROWSER_ICECAT

$BROWSER_ICECAT : 

Type

$BROWSER_NOKIA_S60

$BROWSER_NOKIA_S60 : 

Type

$BROWSER_NOKIA

$BROWSER_NOKIA : 

Type

$BROWSER_MSN

$BROWSER_MSN : 

Type

$BROWSER_MSNBOT

$BROWSER_MSNBOT : 

Type

$BROWSER_NETSCAPE_NAVIGATOR

$BROWSER_NETSCAPE_NAVIGATOR : 

Type

$BROWSER_GALEON

$BROWSER_GALEON : 

Type

$BROWSER_NETPOSITIVE

$BROWSER_NETPOSITIVE : 

Type

$BROWSER_PHOENIX

$BROWSER_PHOENIX : 

Type

$PLATFORM_UNKNOWN

$PLATFORM_UNKNOWN : 

Type

$PLATFORM_WINDOWS

$PLATFORM_WINDOWS : 

Type

$PLATFORM_WINDOWS_CE

$PLATFORM_WINDOWS_CE : 

Type

$PLATFORM_APPLE

$PLATFORM_APPLE : 

Type

$PLATFORM_LINUX

$PLATFORM_LINUX : 

Type

$PLATFORM_OS2

$PLATFORM_OS2 : 

Type

$PLATFORM_BEOS

$PLATFORM_BEOS : 

Type

$PLATFORM_IPHONE

$PLATFORM_IPHONE : 

Type

$PLATFORM_IPOD

$PLATFORM_IPOD : 

Type

$PLATFORM_IPAD

$PLATFORM_IPAD : 

Type

$PLATFORM_BLACKBERRY

$PLATFORM_BLACKBERRY : 

Type

$PLATFORM_NOKIA

$PLATFORM_NOKIA : 

Type

$PLATFORM_FREEBSD

$PLATFORM_FREEBSD : 

Type

$PLATFORM_OPENBSD

$PLATFORM_OPENBSD : 

Type

$PLATFORM_NETBSD

$PLATFORM_NETBSD : 

Type

$PLATFORM_SUNOS

$PLATFORM_SUNOS : 

Type

$PLATFORM_OPENSOLARIS

$PLATFORM_OPENSOLARIS : 

Type

$PLATFORM_ANDROID

$PLATFORM_ANDROID : 

Type

$OPERATING_SYSTEM_UNKNOWN

$OPERATING_SYSTEM_UNKNOWN : 

Type

Methods

__construct()

__construct(  $useragent = "") 

Parameters

$useragent

reset()

reset() 

Reset all properties

isBrowser()

isBrowser(string  $browserName) : True

Check to see if the specific browser is valid

Parameters

string $browserName

Returns

True —

if the browser is the specified browser

getBrowser()

getBrowser() : string

The name of the browser. All return types are from the class contants

Returns

string —

Name of the browser

setBrowser()

setBrowser(\unknown  $browser) 

Set the name of the browser

Parameters

\unknown $browser

The name of the Browser

getPlatform()

getPlatform() : string

The name of the platform. All return types are from the class contants

Returns

string —

Name of the browser

setPlatform()

setPlatform(\unknown  $platform) 

Set the name of the platform

Parameters

\unknown $platform

The name of the Platform

getVersion()

getVersion() : string

The version of the browser.

Returns

string —

Version of the browser (will only contain alpha-numeric characters and a period)

setVersion()

setVersion(\unknown  $version) 

Set the version of the browser

Parameters

\unknown $version

The version of the Browser

getAolVersion()

getAolVersion() : string

The version of AOL.

Returns

string —

Version of AOL (will only contain alpha-numeric characters and a period)

setAolVersion()

setAolVersion(\unknown  $version) 

Set the version of AOL

Parameters

\unknown $version

The version of AOL

isAol()

isAol() : boolean

Is the browser from AOL?

Returns

boolean —

True if the browser is from AOL otherwise false

isMobile()

isMobile() : boolean

Is the browser from a mobile device?

Returns

boolean —

True if the browser is from a mobile device otherwise false

isRobot()

isRobot() : boolean

Is the browser from a robot (ex Slurp,GoogleBot)?

Returns

boolean —

True if the browser is from a robot otherwise false

setAol()

setAol(\unknown  $isAol) 

Set the browser to be from AOL

Parameters

\unknown $isAol

setMobile()

setMobile(boolean  $value = true) 

Set the Browser to be mobile

Parameters

boolean $value

is the browser a mobile brower or not

setRobot()

setRobot(boolean  $value = true) 

Set the Browser to be a robot

Parameters

boolean $value

is the browser a robot or not

getUserAgent()

getUserAgent() : string

Get the user agent value in use to determine the browser

Returns

string —

The user agent from the HTTP header

setUserAgent()

setUserAgent(\unknown  $agent_string) 

Set the user agent value (the construction will use the HTTP header value - this will overwrite it)

Parameters

\unknown $agent_string

The value for the User Agent

isChromeFrame()

isChromeFrame() : boolean

Used to determine if the browser is actually "chromeframe"

Returns

boolean —

True if the browser is using chromeframe

__toString()

__toString() : string

Returns a formatted string with a summary of the details of the browser.

Returns

string —

formatted string with a summary of the browser

determine()

determine() 

Protected routine to calculate and determine what the browser is in use (including platform)

checkBrowsers()

checkBrowsers() : boolean

Protected routine to determine the browser type

Returns

boolean —

True if the browser was detected otherwise false

checkBrowserBlackBerry()

checkBrowserBlackBerry() : boolean

Determine if the user is using a BlackBerry (last updated 1.7)

Returns

boolean —

True if the browser is the BlackBerry browser otherwise false

checkForAol()

checkForAol() : boolean

Determine if the user is using an AOL User Agent (last updated 1.7)

Returns

boolean —

True if the browser is from AOL otherwise false

checkBrowserGoogleBot()

checkBrowserGoogleBot() : boolean

Determine if the browser is the GoogleBot or not (last updated 1.7)

Returns

boolean —

True if the browser is the GoogletBot otherwise false

checkBrowserMSNBot()

checkBrowserMSNBot() : boolean

Determine if the browser is the MSNBot or not (last updated 1.9)

Returns

boolean —

True if the browser is the MSNBot otherwise false

checkBrowserW3CValidator()

checkBrowserW3CValidator() : boolean

Determine if the browser is the W3C Validator or not (last updated 1.7)

Returns

boolean —

True if the browser is the W3C Validator otherwise false

checkBrowserSlurp()

checkBrowserSlurp() : boolean

Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)

Returns

boolean —

True if the browser is the Yahoo! Slurp Robot otherwise false

checkBrowserInternetExplorer()

checkBrowserInternetExplorer() : boolean

Determine if the browser is Internet Explorer or not (last updated 1.7)

Returns

boolean —

True if the browser is Internet Explorer otherwise false

checkBrowserOpera()

checkBrowserOpera() : boolean

Determine if the browser is Opera or not (last updated 1.7)

Returns

boolean —

True if the browser is Opera otherwise false

checkBrowserChrome()

checkBrowserChrome() : boolean

Determine if the browser is Chrome or not (last updated 1.7)

Returns

boolean —

True if the browser is Chrome otherwise false

checkBrowserWebTv()

checkBrowserWebTv() : boolean

Determine if the browser is WebTv or not (last updated 1.7)

Returns

boolean —

True if the browser is WebTv otherwise false

checkBrowserNetPositive()

checkBrowserNetPositive() : boolean

Determine if the browser is NetPositive or not (last updated 1.7)

Returns

boolean —

True if the browser is NetPositive otherwise false

checkBrowserGaleon()

checkBrowserGaleon() : boolean

Determine if the browser is Galeon or not (last updated 1.7)

Returns

boolean —

True if the browser is Galeon otherwise false

checkBrowserKonqueror()

checkBrowserKonqueror() : boolean

Determine if the browser is Konqueror or not (last updated 1.7)

Returns

boolean —

True if the browser is Konqueror otherwise false

checkBrowserIcab()

checkBrowserIcab() : boolean

Determine if the browser is iCab or not (last updated 1.7)

Returns

boolean —

True if the browser is iCab otherwise false

checkBrowserOmniWeb()

checkBrowserOmniWeb() : boolean

Determine if the browser is OmniWeb or not (last updated 1.7)

Returns

boolean —

True if the browser is OmniWeb otherwise false

checkBrowserPhoenix()

checkBrowserPhoenix() : boolean

Determine if the browser is Phoenix or not (last updated 1.7)

Returns

boolean —

True if the browser is Phoenix otherwise false

checkBrowserFirebird()

checkBrowserFirebird() : boolean

Determine if the browser is Firebird or not (last updated 1.7)

Returns

boolean —

True if the browser is Firebird otherwise false

checkBrowserNetscapeNavigator9Plus()

checkBrowserNetscapeNavigator9Plus() : boolean

Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7) NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)

Returns

boolean —

True if the browser is Netscape Navigator 9+ otherwise false

checkBrowserShiretoko()

checkBrowserShiretoko() : boolean

Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)

Returns

boolean —

True if the browser is Shiretoko otherwise false

checkBrowserIceCat()

checkBrowserIceCat() : boolean

Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)

Returns

boolean —

True if the browser is Ice Cat otherwise false

checkBrowserNokia()

checkBrowserNokia() : boolean

Determine if the browser is Nokia or not (last updated 1.7)

Returns

boolean —

True if the browser is Nokia otherwise false

checkBrowserFirefox()

checkBrowserFirefox() : boolean

Determine if the browser is Firefox or not (last updated 1.7)

Returns

boolean —

True if the browser is Firefox otherwise false

checkBrowserIceweasel()

checkBrowserIceweasel() : boolean

Determine if the browser is Firefox or not (last updated 1.7)

Returns

boolean —

True if the browser is Firefox otherwise false

checkBrowserMozilla()

checkBrowserMozilla() : boolean

Determine if the browser is Mozilla or not (last updated 1.7)

Returns

boolean —

True if the browser is Mozilla otherwise false

checkBrowserLynx()

checkBrowserLynx() : boolean

Determine if the browser is Lynx or not (last updated 1.7)

Returns

boolean —

True if the browser is Lynx otherwise false

checkBrowserAmaya()

checkBrowserAmaya() : boolean

Determine if the browser is Amaya or not (last updated 1.7)

Returns

boolean —

True if the browser is Amaya otherwise false

checkBrowserSafari()

checkBrowserSafari() : boolean

Determine if the browser is Safari or not (last updated 1.7)

Returns

boolean —

True if the browser is Safari otherwise false

checkBrowseriPhone()

checkBrowseriPhone() : boolean

Determine if the browser is iPhone or not (last updated 1.7)

Returns

boolean —

True if the browser is iPhone otherwise false

checkBrowseriPad()

checkBrowseriPad() : boolean

Determine if the browser is iPod or not (last updated 1.7)

Returns

boolean —

True if the browser is iPod otherwise false

checkBrowseriPod()

checkBrowseriPod() : boolean

Determine if the browser is iPod or not (last updated 1.7)

Returns

boolean —

True if the browser is iPod otherwise false

checkBrowserAndroid()

checkBrowserAndroid() : boolean

Determine if the browser is Android or not (last updated 1.7)

Returns

boolean —

True if the browser is Android otherwise false

checkPlatform()

checkPlatform() 

Determine the user's platform (last updated 1.7)