Class: BrowserDetection
Source Location: /BrowserDetection.php
The BrowserDetection class facilitates the identification of the user's environment such as Web browser, version, platform or if it's a mobile device.
Author(s):
- Alexandre Valiquette, Chris Schuld, Gary White
Version:
Copyright:
- Copyright (c) 2014, Wolfcast
|
|
|
|
Class Details
Class Variables
Class Methods
constructor __construct [line 153]
BrowserDetection __construct(
[string
$useragent = ''])
|
|
BrowserDetection class constructor.
Tags:
Parameters:
method checkBrowserAmaya [line 385]
boolean checkBrowserAmaya(
)
|
|
Determine if the browser is the Amaya Web editor or not.
Tags:
method checkBrowserAndroid [line 396]
boolean checkBrowserAndroid(
)
|
|
Determine if the browser is the Android browser (based on the WebKit layout engine and coupled with Chrome's JavaScript engine) or not.
Tags:
method checkBrowserBingbot [line 408]
boolean checkBrowserBingbot(
)
|
|
Determine if the browser is the Bingbot crawler or not.
Tags:
method checkBrowserBlackBerry [line 419]
boolean checkBrowserBlackBerry(
)
|
|
Determine if the browser is the BlackBerry browser or not.
Tags:
method checkBrowserChrome [line 455]
boolean checkBrowserChrome(
)
|
|
Determine if the browser is Chrome or not.
Tags:
method checkBrowserFirebird [line 465]
boolean checkBrowserFirebird(
)
|
|
Determine if the browser is Firebird or not. Firebird was the name of Firefox from version 0.6 to 0.7.1.
Tags:
method checkBrowserFirefox [line 476]
boolean checkBrowserFirefox(
)
|
|
Determine if the browser is Firefox or not.
Tags:
method checkBrowserGaleon [line 498]
boolean checkBrowserGaleon(
)
|
|
Determine if the browser is Galeon or not. The browser was discontinued on September 27, 2008.
Tags:
method checkBrowserGooglebot [line 508]
boolean checkBrowserGooglebot(
)
|
|
Determine if the browser is the Googlebot crawler or not.
Tags:
method checkBrowserIcab [line 519]
boolean checkBrowserIcab(
)
|
|
Determine if the browser is iCab or not.
Tags:
method checkBrowserIceCat [line 531]
boolean checkBrowserIceCat(
)
|
|
Determine if the browser is GNU IceCat (formerly known as GNU IceWeasel) or not.
Tags:
method checkBrowserIceWeasel [line 542]
boolean checkBrowserIceWeasel(
)
|
|
Determine if the browser is GNU IceWeasel (now know as GNU IceCat) or not.
Tags:
method checkBrowserInternetExplorer [line 554]
boolean checkBrowserInternetExplorer(
)
|
|
Determine if the browser is Internet Explorer or not.
Tags:
method checkBrowserKonqueror [line 647]
boolean checkBrowserKonqueror(
)
|
|
Determine if the browser is Konqueror or not.
Tags:
method checkBrowserLynx [line 659]
boolean checkBrowserLynx(
)
|
|
Determine if the browser is Lynx or not. It is the oldest web browser currently in general use and development. It is a text-based only Web browser.
Tags:
method checkBrowserMozilla [line 669]
boolean checkBrowserMozilla(
)
|
|
Determine if the browser is Mozilla or not.
Tags:
method checkBrowserMsnBot [line 680]
boolean checkBrowserMsnBot(
)
|
|
Determine if the browser is the MSNBot crawler or not. In October 2010 it was replaced by the Bingbot robot.
Tags:
method checkBrowserMsnTv [line 691]
boolean checkBrowserMsnTv(
)
|
|
Determine if the browser is MSN TV (formerly WebTV) or not.
Tags:
method checkBrowserNetPositive [line 702]
boolean checkBrowserNetPositive(
)
|
|
Determine if the browser is NetPositive or not. The browser is discontinued since November 2001.
Tags:
method checkBrowserNetscape [line 713]
boolean checkBrowserNetscape(
)
|
|
Determine if the browser is Netscape or not. Official support for this browser ended on March 1st, 2008.
Tags:
method checkBrowserNokia [line 764]
boolean checkBrowserNokia(
)
|
|
Determine if the browser is a Nokia browser or not.
Tags:
method checkBrowserOmniWeb [line 788]
boolean checkBrowserOmniWeb(
)
|
|
Determine if the browser is OmniWeb or not.
Tags:
method checkBrowserOpera [line 810]
boolean checkBrowserOpera(
)
|
|
Determine if the browser is Opera or not.
Tags:
method checkBrowserPhoenix [line 840]
boolean checkBrowserPhoenix(
)
|
|
Determine if the browser is Phoenix or not. Phoenix was the name of Firefox from version 0.1 to 0.5.
Tags:
method checkBrowsers [line 849]
Determine what is the browser used by the user.
Tags:
method checkBrowserSafari [line 898]
boolean checkBrowserSafari(
)
|
|
Determine if the browser is Safari or not.
Tags:
method checkBrowserSlurp [line 937]
boolean checkBrowserSlurp(
)
|
|
Determine if the browser is the Yahoo! Slurp crawler or not.
Tags:
method checkBrowserUAWithVersion [line 954]
boolean checkBrowserUAWithVersion(
mixed
$uaNameToLookFor, string
$userAgent, string
$browserName, [boolean
$isMobile = false], [boolean
$isRobot = false])
|
|
Test the user agent for a specific browser that use a "Version" string (like Safari and Opera). The user agent should look like: "Version/1.0 Browser name/123.456" or "Browser name/123.456 Version/1.0".
Tags:
Parameters:
method checkBrowserW3CValidator [line 988]
boolean checkBrowserW3CValidator(
)
|
|
Determine if the browser is the W3C Validator or not.
Tags:
method checkBrowserYahooMultimedia [line 1025]
boolean checkBrowserYahooMultimedia(
)
|
|
Determine if the browser is the Yahoo! multimedia crawler or not.
Tags:
method checkForAol [line 1035]
Determine if the user is using an AOL "optimized" browser or not.
Tags:
method checkPlatform [line 1062]
Determine the user's platform.
Tags:
method checkSimpleBrowserUA [line 1142]
boolean checkSimpleBrowserUA(
mixed
$uaNameToLookFor, string
$userAgent, string
$browserName, [boolean
$isMobile = false], [boolean
$isRobot = false], [string
$separator = '/'])
|
|
Test the user agent for a specific browser where the browser name is immediately followed by the version number. The user agent should look like: "Browser name/1.0" or "Browser 1.0;".
Tags:
Parameters:
method cleanVersion [line 1192]
string cleanVersion(
string
$version)
|
|
Clean a version string from unwanted characters.
Tags:
Parameters:
method compareVersions [line 201]
int compareVersions(
string
$sourceVer, string
$compareVer)
|
|
Compare two version number strings.
Tags:
Parameters:
method detect [line 1179]
Detect the user environment from the details in the user agent string.
Tags:
method getAolVersion [line 243]
Get the version of AOL (if any). AOL releases "optimized" Internet Explorer and Firefox versions. In the making they add their version number in the user agent string of these browsers.
Tags:
method getBrowser [line 253]
Get the name of the browser. All of the return values are class constants. You can compare them like this: $myBrowserInstance->getBrowser() == BrowserDetection::BROWSER_FIREFOX.
Tags:
method getIECompatibilityView [line 268]
mixed getIECompatibilityView(
[bool
$asArray = false])
|
|
Get the name and version of the browser emulated in the compatibility view mode (if any). Since Internet Explorer 8, IE can be put in compatibility mode to make websites that were created for older browsers, especially IE 6 and 7, look better in IE 8+ which renders web pages closer to the standards and thus differently from those older versions of IE.
Tags:
Parameters:
method getPlatform [line 283]
Get the name of the platform on which the browser is runned on (such as Windows, Apple, iPhone, etc.). All of the return values are class constants. You can compare them like this: $myBrowserInstance->getPlatform() == BrowserDetection::PLATFORM_ANDROID.
Tags:
method getUserAgent [line 292]
Get the user agent value used by the class to determine the browser details.
Tags:
method getVersion [line 301]
Get the version of the browser.
Tags:
method isAol [line 311]
Determine if the browser is from AOL. AOL releases "optimized" Internet Explorer and Firefox versions. In the making they add their details in the user agent string of these browsers.
Tags:
method isChromeFrame [line 321]
Determine if the browser runs Google Chrome Frame (it's a plug-in designed for Internet Explorer 6+ based on the open-source Chromium project - it's like a Chrome browser within IE).
Tags:
method isInIECompatibilityView [line 332]
boolean isInIECompatibilityView(
)
|
|
Determine if the browser is in compatibility view or not. Since Internet Explorer 8, IE can be put in compatibility mode to make websites that were created for older browsers, especially IE 6 and 7, look better in IE 8+ which renders web pages closer to the standards and thus differently from those older versions of IE.
Tags:
method isMobile [line 341]
Determine if the browser is from a mobile device or not.
Tags:
method isRobot [line 350]
Determine if the browser is a robot (Googlebot, Bingbot, Yahoo! Slurp...) or not.
Tags:
method parseInt [line 1214]
int parseInt(
string
$intStr)
|
|
Get the integer value of a string variable.
Tags:
Parameters:
method reset [line 1223]
Reset all the properties of the class.
Tags:
method safariBuildToSafariVer [line 1245]
string safariBuildToSafariVer(
string
$version)
|
|
Convert a Safari build number to a Safari version number.
Tags:
Parameters:
method setAol [line 1326]
void setAol(
boolean
$isAol)
|
|
Set the browser to be from AOL or not.
Tags:
Parameters:
method setAolVersion [line 1336]
void setAolVersion(
string
$version)
|
|
Set the version of AOL.
Tags:
Parameters:
method setBrowser [line 1348]
void setBrowser(
string
$browserName)
|
|
Set the name of the browser.
Tags:
Parameters:
method setMobile [line 1358]
void setMobile(
[boolean
$isMobile = true])
|
|
Set the browser to be from a mobile device or not.
Tags:
Parameters:
method setPlatform [line 1368]
void setPlatform(
string
$platform)
|
|
Set the platform on which the browser is on.
Tags:
Parameters:
method setRobot [line 1378]
void setRobot(
[boolean
$isRobot = true])
|
|
Set the browser to be a robot (crawler) or not.
Tags:
Parameters:
method setUserAgent [line 360]
void setUserAgent(
[string
$agentString = ''])
|
|
Set the user agent to use with the class.
Tags:
Parameters:
method setVersion [line 1388]
void setVersion(
string
$version)
|
|
Set the version of the browser.
Tags:
Parameters:
method webKitBuildToSafariVer [line 1407]
string webKitBuildToSafariVer(
string
$version)
|
|
Convert a WebKit build number to a Safari version number.
Tags:
Parameters:
method __toString [line 162]
Determine how the class will react when it is treated like a string.
Tags:
Class Constants
|
|