Back to Joomla project (class list)

Class Browser - list of methods

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.
Package: Joomla\CMS\Environment
Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Environment/Browser.php
Project: Joomla

Method Summary

public
(mixed $userAgent = null, mixed $accept = null)

Create a browser instance (constructor).
Parameters
  • string $userAgent The browser string to parse.
  • string $accept The HTTP_ACCEPT settings to use.
Since
  • 1.7.0
Show source code of this method: __construct Source Code

public static \Joomla\CMS\Environment\Browser
(mixed $userAgent = null, mixed $accept = null)

Returns the global Browser object, only creating it if it doesn't already exist.
Parameters
  • string $userAgent The browser string to parse.
  • string $accept The HTTP_ACCEPT settings to use.
Returns
  • \Joomla\CMS\Environment\Browser The Browser object.
Since
  • 1.7.0
Show source code of this method: getInstance Source Code

public void
(mixed $userAgent = null, mixed $accept = null)

Parses the user agent string and inititializes the object with all the known features and quirks for the given browser.
Parameters
  • string $userAgent The browser string to parse.
  • string $accept The HTTP_ACCEPT settings to use.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: match Source Code

protected void
()

Match the platform of the browser.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: _setPlatform Source Code

public string
()

Return the currently matched platform.
Returns
  • string The user's platform.
Since
  • 1.7.0
Show source code of this method: getPlatform Source Code

protected void
()

Set browser version, not by engine version Fallback to use when no other method identify the engine version
Returns
  • void
Since
  • 1.7.0
Show source code of this method: identifyBrowserVersion Source Code

public void
(mixed $browser)

Sets the current browser.
Parameters
  • string $browser The browser to set as current.
Returns
  • void
Since
  • 1.7.0
Show source code of this method: setBrowser Source Code

public string
()

Retrieve the current browser.
Returns
  • string The current browser.
Since
  • 1.7.0
Show source code of this method: getBrowser Source Code

public int
()

Retrieve the current browser's major version.
Returns
  • int The current browser's major version
Since
  • 1.7.0
Show source code of this method: getMajor Source Code

public int
()

Retrieve the current browser's minor version.
Returns
  • int The current browser's minor version.
Since
  • 1.7.0
Show source code of this method: getMinor Source Code

public string
()

Retrieve the current browser's version.
Returns
  • string The current browser's version.
Since
  • 1.7.0
Show source code of this method: getVersion Source Code

public string
()

Return the full browser agent string.
Returns
  • string The browser agent string
Since
  • 1.7.0
Show source code of this method: getAgentString Source Code

public string
()

Returns the server protocol in use on the current server.
Returns
  • string The HTTP server protocol version.
Since
  • 1.7.0
Show source code of this method: getHTTPProtocol Source Code

public bool
(mixed $mimetype)

Determines if a browser can display a given MIME type.
Parameters
  • string $mimetype The MIME type to check.
Returns
  • bool True if the browser can display the MIME type.
Since
  • 1.7.0
Show source code of this method: isViewable Source Code

public bool
(mixed $browser)

Determine if the given browser is the same as the current.
Parameters
  • string $browser The browser to check.
Returns
  • bool Is the given browser the same as the current?
Since
  • 1.7.0
Show source code of this method: isBrowser Source Code

public bool
()

Determines if the browser is a robot or not.
Returns
  • bool True if browser is a known robot.
Since
  • 1.7.0
Show source code of this method: isRobot Source Code

public bool
()

Determines if the browser is mobile version or not.
Returns
  • bool True if browser is a known mobile version.
Since
  • 1.7.0
Show source code of this method: isMobile Source Code

Properties Summary

protected int
$majorVersion
Since
  • 3.0.0
protected int
$minorVersion
Since
  • 3.0.0
protected string
$browser
Since
  • 3.0.0
protected string
$agent
Since
  • 3.0.0
protected string
$lowerAgent
Since
  • 3.0.0
protected string
$accept
Since
  • 3.0.0
protected array
$acceptParsed
Since
  • 3.0.0
protected string
$platform
Since
  • 3.0.0
protected array
$robots
Since
  • 3.0.0
protected bool
$mobile
Since
  • 3.0.0
protected array
$images
List of viewable image MIME subtypes.
Since
  • 3.0.0
protected static array
$instances
Since
  • 1.7.3

Tags Summary

Since
1.7.0