\JBrowser
Browser class, provides capability information about the current web client.
Browser identification is performed by examining the HTTP_USER_AGENT
environment variable provided by the web server.
This class has many influences from the lib/Browser.php code in
version 3 of Horde by Chuck Hagenbuch and Jon Parise.
Synopsis
class JBrowser
{
- // members
- protected $majorVersion;
- protected $minorVersion;
- protected $browser;
- protected $agent;
- protected $lowerAgent;
- protected $accept;
- protected $acceptParsed;
- protected $platform;
- protected $robots;
- protected $mobile;
- protected $images;
- protected $instances;
- // methods
- public void __construct()
- public static JBrowser getInstance()
- public void match()
- protected void _setPlatform()
- public string getPlatform()
- protected void identifyBrowserVersion()
- public void setBrowser()
- public string getBrowser()
- public integer getMajor()
- public integer getMinor()
- public string getVersion()
- public string getAgentString()
- public string getHTTPProtocol()
- public boolean isViewable()
- public boolean isBrowser()
- public boolean isRobot()
- public boolean isMobile()
- public boolean isSSLConnection()
Members
protected
- $accept — string
- $acceptParsed — array
- $agent — string
- $browser — string
- $images
—
array
List of viewable image MIME subtypes. - $instances — array
- $lowerAgent — string
- $majorVersion — integer
- $minorVersion — integer
- $mobile — boolean
- $platform — string
- $robots — array
Methods
protected
- _setPlatform() — Match the platform of the browser.
- identifyBrowserVersion() — Set browser version, not by engine version Fallback to use when no other method identify the engine version
public
- __construct() — Create a browser instance (constructor).
- getAgentString() — Return the full browser agent string.
- getBrowser() — Retrieve the current browser.
- getHTTPProtocol() — Returns the server protocol in use on the current server.
- getInstance() — Returns the global Browser object, only creating it if it doesn't already exist.
- getMajor() — Retrieve the current browser's major version.
- getMinor() — Retrieve the current browser's minor version.
- getPlatform() — Return the currently matched platform.
- getVersion() — Retrieve the current browser's version.
- isBrowser() — Determine if the given browser is the same as the current.
- isMobile() — Determines if the browser is mobile version or not.
- isRobot() — Determines if the browser is a robot or not.
- isSSLConnection() — Determine if we are using a secure (SSL) connection.
- isViewable() — Determines if a browser can display a given MIME type.
- match() — Parses the user agent string and inititializes the object with all the known features and quirks for the given browser.
- setBrowser() — Sets the current browser.