[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Environment/ -> Browser.php (summary)

Joomla! Content Management System

Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 929 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Browser:: (17 methods):
  __construct()
  getInstance()
  match()
  _setPlatform()
  getPlatform()
  identifyBrowserVersion()
  setBrowser()
  getBrowser()
  getMajor()
  getMinor()
  getVersion()
  getAgentString()
  getHTTPProtocol()
  isViewable()
  isBrowser()
  isRobot()
  isMobile()


Class: Browser  - X-Ref

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.

__construct($userAgent = null, $accept = null)   X-Ref
Create a browser instance (constructor).

param: string  $userAgent  The browser string to parse.
param: string  $accept     The HTTP_ACCEPT settings to use.

getInstance($userAgent = null, $accept = null)   X-Ref
Returns the global Browser object, only creating it
if it doesn't already exist.

param: string  $userAgent  The browser string to parse.
param: string  $accept     The HTTP_ACCEPT settings to use.
return: Browser  The Browser object.

match($userAgent = null, $accept = null)   X-Ref
Parses the user agent string and inititializes the object with
all the known features and quirks for the given browser.

param: string  $userAgent  The browser string to parse.
param: string  $accept     The HTTP_ACCEPT settings to use.
return: void

_setPlatform()   X-Ref
Match the platform of the browser.

This is a pretty simplistic implementation, but it's intended
to let us tell what line breaks to send, so it's good enough
for its purpose.

return: void

getPlatform()   X-Ref
Return the currently matched platform.

return: string  The user's platform.

identifyBrowserVersion()   X-Ref
Set browser version, not by engine version
Fallback to use when no other method identify the engine version

return: void

setBrowser($browser)   X-Ref
Sets the current browser.

param: string  $browser  The browser to set as current.
return: void

getBrowser()   X-Ref
Retrieve the current browser.

return: string  The current browser.

getMajor()   X-Ref
Retrieve the current browser's major version.

return: integer  The current browser's major version

getMinor()   X-Ref
Retrieve the current browser's minor version.

return: integer  The current browser's minor version.

getVersion()   X-Ref
Retrieve the current browser's version.

return: string  The current browser's version.

getAgentString()   X-Ref
Return the full browser agent string.

return: string  The browser agent string

getHTTPProtocol()   X-Ref
Returns the server protocol in use on the current server.

return: string  The HTTP server protocol version.

isViewable($mimetype)   X-Ref
Determines if a browser can display a given MIME type.

Note that  image/jpeg and image/pjpeg *appear* to be the same
entity, but Mozilla doesn't seem to want to accept the latter.
For our purposes, we will treat them the same.

param: string  $mimetype  The MIME type to check.
return: boolean  True if the browser can display the MIME type.

isBrowser($browser)   X-Ref
Determine if the given browser is the same as the current.

param: string  $browser  The browser to check.
return: boolean  Is the given browser the same as the current?

isRobot()   X-Ref
Determines if the browser is a robot or not.

return: boolean  True if browser is a known robot.

isMobile()   X-Ref
Determines if the browser is mobile version or not.

return: boolean  True if browser is a known mobile version.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer