Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($userAgent=null, $accept=null) | |
match ($userAgent=null, $accept=null) | |
getPlatform () | |
setBrowser ($browser) | |
getBrowser () | |
getMajor () | |
getMinor () | |
getVersion () | |
getAgentString () | |
getHTTPProtocol () | |
isViewable ($mimetype) | |
isBrowser ($browser) | |
isRobot () | |
isMobile () | |
Fonctions membres publiques statiques | |
static | getInstance ($userAgent=null, $accept=null) |
Fonctions membres protégées | |
_setPlatform () | |
identifyBrowserVersion () | |
Attributs protégés | |
$majorVersion = 0 | |
$minorVersion = 0 | |
$browser = '' | |
$agent = '' | |
$lowerAgent = '' | |
$accept = '' | |
$acceptParsed = array() | |
$platform = '' | |
$robots | |
$mobile = false | |
$images = array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp') | |
Attributs protégés statiques | |
static | $instances = array() |
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.
Create a browser instance (constructor).
string | $userAgent | The browser string to parse. |
string | $accept | The HTTP_ACCEPT settings to use. |
|
protected |
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.
Références elseif.
getAgentString | ( | ) |
Return the full browser agent string.
getBrowser | ( | ) |
Retrieve the current browser.
getHTTPProtocol | ( | ) |
Returns the server protocol in use on the current server.
Returns the global Browser object, only creating it if it doesn't already exist.
string | $userAgent | The browser string to parse. |
string | $accept | The HTTP_ACCEPT settings to use. |
Référencé par BannersHelper\getList(), et HTMLHelper\includeRelativeFiles().
getMajor | ( | ) |
Retrieve the current browser's major version.
getMinor | ( | ) |
Retrieve the current browser's minor version.
Références $minorVersion.
getPlatform | ( | ) |
Return the currently matched platform.
getVersion | ( | ) |
Retrieve the current browser's version.
Références $minorVersion.
|
protected |
Set browser version, not by engine version Fallback to use when no other method identify the engine version
Références $version.
isBrowser | ( | $browser | ) |
Determine if the given browser is the same as the current.
string | $browser | The browser to check. |
isMobile | ( | ) |
Determines if the browser is mobile version or not.
isRobot | ( | ) |
Determines if the browser is a robot or not.
isViewable | ( | $mimetype | ) |
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.
string | $mimetype | The MIME type to check. |
Références $type.
Parses the user agent string and inititializes the object with all the known features and quirks for the given browser.
string | $userAgent | The browser string to parse. |
string | $accept | The HTTP_ACCEPT settings to use. |
We have to check for Edge as the first browser, because Edge has something like: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3738.0 Safari/537.36 Edg/75.0.107.0
setBrowser | ( | $browser | ) |
Sets the current browser.
string | $browser | The browser to set as current. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |