PHP Class NukeViet\Client\Browser

Afficher le fichier Open project: nukeviet/nukeviet

Méthodes publiques

Méthode Description
__construct ( $userAgent = "" )
__toString ( ) : string Returns a formatted string with a summary of the details of the browser.
getAolVersion ( ) : string The version of AOL.
getBrowser ( ) : string The name of the browser. All return types are from the class contants
getBrowserKey ( ) : string The key of the browser. All return types are from the class contants
getPlatform ( ) : string The name of the platform. All return types are from the class contants
getPlatformKey ( )
getUserAgent ( ) : string Get the user agent value in use to determine the browser
getVersion ( ) : string The version of the browser.
isAol ( ) : boolean Is the browser from AOL?
isBrowser ( string $browserName ) : boolean Check to see if the specific browser is valid
isChromeFrame ( ) : boolean Used to determine if the browser is actually "chromeframe"
isFacebook ( ) : boolean Is the browser from facebook?
isMobile ( ) : boolean Is the browser from a mobile device?
isRobot ( ) : boolean Is the browser from a robot (ex Slurp,GoogleBot)?
isTablet ( ) : boolean Is the browser from a tablet device?
reset ( ) Reset all properties
setAol ( $isAol ) Set the browser to be from AOL
setAolVersion ( string $version ) Set the version of AOL
setBrowser ( $browser, $browser_name ) Set the name of the browser
setPlatform ( string $platform ) Set the name of the platform
setUserAgent ( string $agent_string ) Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
setVersion ( string $version ) Set the version of the browser

Méthodes protégées

Méthode Description
checkBrowserAmaya ( ) : boolean Determine if the browser is Amaya or not (last updated 1.7)
checkBrowserAndroid ( ) : boolean Determine if the browser is Android or not (last updated 1.7)
checkBrowserBingBot ( ) : boolean Determine if the browser is the BingBot or not (last updated 1.9)
checkBrowserBlackBerry ( ) : boolean Determine if the user is using a BlackBerry (last updated 1.7)
checkBrowserChrome ( ) : boolean Determine if the browser is Chrome or not (last updated 1.7)
checkBrowserFirebird ( ) : boolean Determine if the browser is Firebird or not (last updated 1.7)
checkBrowserFirefox ( ) : boolean Determine if the browser is Firefox or not (last updated 1.7)
checkBrowserGaleon ( ) : boolean Determine if the browser is Galeon or not (last updated 1.7)
checkBrowserGoogleBot ( ) : boolean Determine if the browser is the GoogleBot or not (last updated 1.7)
checkBrowserIcab ( ) : boolean Determine if the browser is iCab or not (last updated 1.7)
checkBrowserIceCat ( ) : boolean Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
checkBrowserIceweasel ( ) : boolean Determine if the browser is Firefox or not (last updated 1.7)
checkBrowserInternetExplorer ( ) : boolean Determine if the browser is Internet Explorer or not (last updated 1.7)
checkBrowserKonqueror ( ) : boolean Determine if the browser is Konqueror or not (last updated 1.7)
checkBrowserLynx ( ) : boolean Determine if the browser is Lynx or not (last updated 1.7)
checkBrowserMSNBot ( ) : boolean Determine if the browser is the MSNBot or not (last updated 1.9)
checkBrowserMozilla ( ) : boolean Determine if the browser is Mozilla or not (last updated 1.7)
checkBrowserNetPositive ( ) : boolean Determine if the browser is NetPositive or not (last updated 1.7)
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)
checkBrowserNokia ( ) : boolean Determine if the browser is Nokia or not (last updated 1.7)
checkBrowserOmniWeb ( ) : boolean Determine if the browser is OmniWeb or not (last updated 1.7)
checkBrowserOpera ( ) : boolean Determine if the browser is Opera or not (last updated 1.7)
checkBrowserPhoenix ( ) : boolean Determine if the browser is Phoenix or not (last updated 1.7)
checkBrowserSafari ( ) : boolean Determine if the browser is Safari or not (last updated 1.7)
checkBrowserShiretoko ( ) : boolean Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
checkBrowserSlurp ( ) : boolean Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
checkBrowserW3CValidator ( ) : boolean Determine if the browser is the W3C Validator or not (last updated 1.7)
checkBrowserWebTv ( ) : boolean Determine if the browser is WebTv or not (last updated 1.7)
checkBrowseriPad ( ) : boolean Determine if the browser is iPad or not (last updated 1.7)
checkBrowseriPhone ( ) : boolean Determine if the browser is iPhone or not (last updated 1.7)
checkBrowseriPod ( ) : boolean Determine if the browser is iPod or not (last updated 1.7)
checkBrowsers ( ) : boolean Protected routine to determine the browser type
checkFacebookExternalHit ( ) : boolean Detect if URL is loaded from FacebookExternalHit
checkForAol ( ) : boolean Determine if the user is using an AOL User Agent (last updated 1.7)
checkForFacebookIos ( ) : boolean Detect if URL is being loaded from internal Facebook browser
checkPlatform ( ) Determine the user's platform (last updated 1.7)
determine ( ) Protected routine to calculate and determine what the browser is in use (including platform)
getChromeVersionOnIos ( ) : boolean Detect Version for the Chrome browser on iOS devices
getSafariVersionOnIos ( ) : boolean Detect Version for the Safari browser on iOS devices
setFacebook ( boolean $value = true ) Set the Browser to be a Facebook request
setMobile ( boolean $value = true ) Set the Browser to be mobile
setRobot ( boolean $value = true ) Set the Browser to be a robot
setTablet ( boolean $value = true ) Set the Browser to be tablet

Method Details

__construct() public méthode

public __construct ( $userAgent = "" )

__toString() public méthode

Returns a formatted string with a summary of the details of the browser.
public __toString ( ) : string
Résultat string formatted string with a summary of the browser

checkBrowserAmaya() protected méthode

Determine if the browser is Amaya or not (last updated 1.7)
protected checkBrowserAmaya ( ) : boolean
Résultat boolean True if the browser is Amaya otherwise false

checkBrowserAndroid() protected méthode

Determine if the browser is Android or not (last updated 1.7)
protected checkBrowserAndroid ( ) : boolean
Résultat boolean True if the browser is Android otherwise false

checkBrowserBingBot() protected méthode

Determine if the browser is the BingBot or not (last updated 1.9)
protected checkBrowserBingBot ( ) : boolean
Résultat boolean True if the browser is the BingBot otherwise false

checkBrowserBlackBerry() protected méthode

Determine if the user is using a BlackBerry (last updated 1.7)
protected checkBrowserBlackBerry ( ) : boolean
Résultat boolean True if the browser is the BlackBerry browser otherwise false

checkBrowserChrome() protected méthode

Determine if the browser is Chrome or not (last updated 1.7)
protected checkBrowserChrome ( ) : boolean
Résultat boolean True if the browser is Chrome otherwise false

checkBrowserFirebird() protected méthode

Determine if the browser is Firebird or not (last updated 1.7)
protected checkBrowserFirebird ( ) : boolean
Résultat boolean True if the browser is Firebird otherwise false

checkBrowserFirefox() protected méthode

Determine if the browser is Firefox or not (last updated 1.7)
protected checkBrowserFirefox ( ) : boolean
Résultat boolean True if the browser is Firefox otherwise false

checkBrowserGaleon() protected méthode

Determine if the browser is Galeon or not (last updated 1.7)
protected checkBrowserGaleon ( ) : boolean
Résultat boolean True if the browser is Galeon otherwise false

checkBrowserGoogleBot() protected méthode

Determine if the browser is the GoogleBot or not (last updated 1.7)
protected checkBrowserGoogleBot ( ) : boolean
Résultat boolean True if the browser is the GoogletBot otherwise false

checkBrowserIcab() protected méthode

Determine if the browser is iCab or not (last updated 1.7)
protected checkBrowserIcab ( ) : boolean
Résultat boolean True if the browser is iCab otherwise false

checkBrowserIceCat() protected méthode

Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
protected checkBrowserIceCat ( ) : boolean
Résultat boolean True if the browser is Ice Cat otherwise false

checkBrowserIceweasel() protected méthode

Determine if the browser is Firefox or not (last updated 1.7)
protected checkBrowserIceweasel ( ) : boolean
Résultat boolean True if the browser is Firefox otherwise false

checkBrowserInternetExplorer() protected méthode

Determine if the browser is Internet Explorer or not (last updated 1.7)
protected checkBrowserInternetExplorer ( ) : boolean
Résultat boolean True if the browser is Internet Explorer otherwise false

checkBrowserKonqueror() protected méthode

Determine if the browser is Konqueror or not (last updated 1.7)
protected checkBrowserKonqueror ( ) : boolean
Résultat boolean True if the browser is Konqueror otherwise false

checkBrowserLynx() protected méthode

Determine if the browser is Lynx or not (last updated 1.7)
protected checkBrowserLynx ( ) : boolean
Résultat boolean True if the browser is Lynx otherwise false

checkBrowserMSNBot() protected méthode

Determine if the browser is the MSNBot or not (last updated 1.9)
protected checkBrowserMSNBot ( ) : boolean
Résultat boolean True if the browser is the MSNBot otherwise false

checkBrowserMozilla() protected méthode

Determine if the browser is Mozilla or not (last updated 1.7)
protected checkBrowserMozilla ( ) : boolean
Résultat boolean True if the browser is Mozilla otherwise false

checkBrowserNetPositive() protected méthode

Determine if the browser is NetPositive or not (last updated 1.7)
protected checkBrowserNetPositive ( ) : boolean
Résultat boolean True if the browser is NetPositive otherwise false

checkBrowserNetscapeNavigator9Plus() protected méthode

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)
protected checkBrowserNetscapeNavigator9Plus ( ) : boolean
Résultat boolean True if the browser is Netscape Navigator 9+ otherwise false

checkBrowserNokia() protected méthode

Determine if the browser is Nokia or not (last updated 1.7)
protected checkBrowserNokia ( ) : boolean
Résultat boolean True if the browser is Nokia otherwise false

checkBrowserOmniWeb() protected méthode

Determine if the browser is OmniWeb or not (last updated 1.7)
protected checkBrowserOmniWeb ( ) : boolean
Résultat boolean True if the browser is OmniWeb otherwise false

checkBrowserOpera() protected méthode

Determine if the browser is Opera or not (last updated 1.7)
protected checkBrowserOpera ( ) : boolean
Résultat boolean True if the browser is Opera otherwise false

checkBrowserPhoenix() protected méthode

Determine if the browser is Phoenix or not (last updated 1.7)
protected checkBrowserPhoenix ( ) : boolean
Résultat boolean True if the browser is Phoenix otherwise false

checkBrowserSafari() protected méthode

Determine if the browser is Safari or not (last updated 1.7)
protected checkBrowserSafari ( ) : boolean
Résultat boolean True if the browser is Safari otherwise false

checkBrowserShiretoko() protected méthode

Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
protected checkBrowserShiretoko ( ) : boolean
Résultat boolean True if the browser is Shiretoko otherwise false

checkBrowserSlurp() protected méthode

Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
protected checkBrowserSlurp ( ) : boolean
Résultat boolean True if the browser is the Yahoo! Slurp Robot otherwise false

checkBrowserW3CValidator() protected méthode

Determine if the browser is the W3C Validator or not (last updated 1.7)
protected checkBrowserW3CValidator ( ) : boolean
Résultat boolean True if the browser is the W3C Validator otherwise false

checkBrowserWebTv() protected méthode

Determine if the browser is WebTv or not (last updated 1.7)
protected checkBrowserWebTv ( ) : boolean
Résultat boolean True if the browser is WebTv otherwise false

checkBrowseriPad() protected méthode

Determine if the browser is iPad or not (last updated 1.7)
protected checkBrowseriPad ( ) : boolean
Résultat boolean True if the browser is iPad otherwise false

checkBrowseriPhone() protected méthode

Determine if the browser is iPhone or not (last updated 1.7)
protected checkBrowseriPhone ( ) : boolean
Résultat boolean True if the browser is iPhone otherwise false

checkBrowseriPod() protected méthode

Determine if the browser is iPod or not (last updated 1.7)
protected checkBrowseriPod ( ) : boolean
Résultat boolean True if the browser is iPod otherwise false

checkBrowsers() protected méthode

Protected routine to determine the browser type
protected checkBrowsers ( ) : boolean
Résultat boolean True if the browser was detected otherwise false

checkFacebookExternalHit() protected méthode

Detect if URL is loaded from FacebookExternalHit
protected checkFacebookExternalHit ( ) : boolean
Résultat boolean True if it detects FacebookExternalHit otherwise false

checkForAol() protected méthode

Determine if the user is using an AOL User Agent (last updated 1.7)
protected checkForAol ( ) : boolean
Résultat boolean True if the browser is from AOL otherwise false

checkForFacebookIos() protected méthode

Detect if URL is being loaded from internal Facebook browser
protected checkForFacebookIos ( ) : boolean
Résultat boolean True if it detects internal Facebook browser otherwise false

checkPlatform() protected méthode

Determine the user's platform (last updated 1.7)
protected checkPlatform ( )

determine() protected méthode

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

getAolVersion() public méthode

The version of AOL.
public getAolVersion ( ) : string
Résultat string Version of AOL (will only contain alpha-numeric characters and a period)

getBrowser() public méthode

The name of the browser. All return types are from the class contants
public getBrowser ( ) : string
Résultat string Name of the browser

getBrowserKey() public méthode

The key of the browser. All return types are from the class contants
public getBrowserKey ( ) : string
Résultat string Key of the browser

getChromeVersionOnIos() protected méthode

Detect Version for the Chrome browser on iOS devices
protected getChromeVersionOnIos ( ) : boolean
Résultat boolean True if it detects the version correctly otherwise false

getPlatform() public méthode

The name of the platform. All return types are from the class contants
public getPlatform ( ) : string
Résultat string Name of the browser

getPlatformKey() public méthode

public getPlatformKey ( )

getSafariVersionOnIos() protected méthode

Detect Version for the Safari browser on iOS devices
protected getSafariVersionOnIos ( ) : boolean
Résultat boolean True if it detects the version correctly otherwise false

getUserAgent() public méthode

Get the user agent value in use to determine the browser
public getUserAgent ( ) : string
Résultat string The user agent from the HTTP header

getVersion() public méthode

The version of the browser.
public getVersion ( ) : string
Résultat string Version of the browser (will only contain alpha-numeric characters and a period)

isAol() public méthode

Is the browser from AOL?
public isAol ( ) : boolean
Résultat boolean True if the browser is from AOL otherwise false

isBrowser() public méthode

Check to see if the specific browser is valid
public isBrowser ( string $browserName ) : boolean
$browserName string
Résultat boolean True if the browser is the specified browser

isChromeFrame() public méthode

Used to determine if the browser is actually "chromeframe"
Since: 1.7
public isChromeFrame ( ) : boolean
Résultat boolean True if the browser is using chromeframe

isFacebook() public méthode

Is the browser from facebook?
public isFacebook ( ) : boolean
Résultat boolean True if the browser is from facebook otherwise false

isMobile() public méthode

Is the browser from a mobile device?
public isMobile ( ) : boolean
Résultat boolean True if the browser is from a mobile device otherwise false

isRobot() public méthode

Is the browser from a robot (ex Slurp,GoogleBot)?
public isRobot ( ) : boolean
Résultat boolean True if the browser is from a robot otherwise false

isTablet() public méthode

Is the browser from a tablet device?
public isTablet ( ) : boolean
Résultat boolean True if the browser is from a tablet device otherwise false

reset() public méthode

Reset all properties
public reset ( )

setAol() public méthode

Set the browser to be from AOL
public setAol ( $isAol )
$isAol

setAolVersion() public méthode

Set the version of AOL
public setAolVersion ( string $version )
$version string The version of AOL

setBrowser() public méthode

Set the name of the browser
public setBrowser ( $browser, $browser_name )
$browser string The name of the Browser

setFacebook() protected méthode

Set the Browser to be a Facebook request
protected setFacebook ( boolean $value = true )
$value boolean is the browser a robot or not

setMobile() protected méthode

Set the Browser to be mobile
protected setMobile ( boolean $value = true )
$value boolean is the browser a mobile browser or not

setPlatform() public méthode

Set the name of the platform
public setPlatform ( string $platform )
$platform string The name of the Platform

setRobot() protected méthode

Set the Browser to be a robot
protected setRobot ( boolean $value = true )
$value boolean is the browser a robot or not

setTablet() protected méthode

Set the Browser to be tablet
protected setTablet ( boolean $value = true )
$value boolean is the browser a tablet browser or not

setUserAgent() public méthode

Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
public setUserAgent ( string $agent_string )
$agent_string string The value for the User Agent

setVersion() public méthode

Set the version of the browser
public setVersion ( string $version )
$version string The version of the Browser