spunQ_HttpClientBrowserInformation Class Reference

Information about the browser of an HTTP client. More...

Inheritance diagram for spunQ_HttpClientBrowserInformation:

spunQ_IHttpClientBrowserInformation

List of all members.

Public Member Functions

 __construct (spunQ_IHttpRequest $request)
 Constructor.
 getBrand ()
 The browser type.
 getVersionString ()
 The whole version string.
 getMajorversion ()
 Major version of the browser.
 isBot ()
 Whether the 'browser' is actually a web crawler.

Public Attributes

const BROWSER_UNKNOWN = 0
 Unidentified browser.
const BROWSER_IE = 1
 Internet explorer.
const BROWSER_FIREFOX = 2
 Mozilla Firefox.
const BROWSER_SAFARI = 3
 Safari.
const BROWSER_CHROME = 4
 Google Chrome.
const BROWSER_OPERA = 5
 Opera.

Protected Member Functions

 init ()
 Initializes all variables.

Protected Attributes

 $brand
 Holds value for getBrand().
 $majorVersion
 Holds value for getMajorversion().
 $versionString
 Holds value for getVersionString().
 $isBot
 Holds value for isBot().


Detailed Description

Information about the browser of an HTTP client.

Definition at line 6 of file HttpClientBrowserInformation.class.php.


Constructor & Destructor Documentation

spunQ_HttpClientBrowserInformation::__construct ( spunQ_IHttpRequest request  ) 

Constructor.

Parameters:
$request The request to extract information from.

Definition at line 40 of file HttpClientBrowserInformation.class.php.


Member Function Documentation

spunQ_HttpClientBrowserInformation::getBrand (  ) 

The browser type.

Returns:
integer Either of the BROWSER_* constants.

Implements spunQ_IHttpClientBrowserInformation.

Definition at line 48 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::getMajorversion (  ) 

Major version of the browser.

Some browser don't have a minor version (*cough* explorer *cough*), while others use obscure versioning strings that are incompatible with the actual browser version (*choke* safari). This is why the major version is the only part common to all browsers.

Type:
integer

Implements spunQ_IHttpClientBrowserInformation.

Definition at line 64 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::getVersionString (  ) 

The whole version string.

Note that version string need not contain its major version number.

Type:
string

Implements spunQ_IHttpClientBrowserInformation.

Definition at line 56 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::isBot (  ) 

Whether the 'browser' is actually a web crawler.

We can be quite sure that a client is a browser, but we cannot know if a malicious bot is not spoofing its user-agent string, so don't trust this value too much.

Returns:
boolean

Implements spunQ_IHttpClientBrowserInformation.

Definition at line 72 of file HttpClientBrowserInformation.class.php.


Member Data Documentation

spunQ_HttpClientBrowserInformation::$brand [protected]

Holds value for getBrand().

Initialized in init().

Type:
integer

Definition at line 13 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::$isBot [protected]

Holds value for isBot().

Initialized in init().

Type:
boolean

Definition at line 34 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::$majorVersion [protected]

Holds value for getMajorversion().

Initialized in init().

Type:
integer

Definition at line 20 of file HttpClientBrowserInformation.class.php.

spunQ_HttpClientBrowserInformation::$versionString [protected]

Holds value for getVersionString().

Initialized in init().

Type:
string

Definition at line 27 of file HttpClientBrowserInformation.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:40 2011 for spunQ3 by  doxygen 1.5.9