Property | Type | Description | |
---|---|---|---|
$_accept | string | HTTP_ACCEPT string | |
$_agent | string | Full user agent string. | |
$_browser | string | Browser name. | |
$_features | array | Features. | |
$_images | array | This list of viewable images works for IE and Netscape/Mozilla. | |
$_lowerAgent | string | Lower-case user agent string. | |
$_majorVersion | integer | Major version number. | |
$_minorVersion | integer | Minor version number. | |
$_mobile | boolean | Is this a mobile browser? | |
$_mobileAgents | Browsers like Mobile Safari (iPhone, iPod Touch) are much more full featured than OpenWave style browsers. This makes it dicey in some cases to treat all "mobile" browsers the same way. | ||
$_platform | string | Platform the browser is running on. | |
$_quirks | array | Quirks. | |
$_robotAgentRegexp | string | Regexp for matching those robot strings. | |
$_robotAgents | array | Known robots. | |
$_tablet | boolean | Is this a tablet browser? | |
$_tvAgents | List of televison user agents. |
Method | Description | |
---|---|---|
__construct ( string $userAgent = null, string $accept = null ) | Creates a browser instance (Constructor). | |
allowFileUploads ( ) : integer | Determines if files can be uploaded to the system. | |
downloadHeaders ( string $filename = 'unknown', string $cType = null, boolean $inline = false, string $cLength = null ) | Returns the headers for a browser download. | |
getAgentString ( ) : string | Returns the full browser agent string. | |
getBrowser ( ) : string | Returns the current browser. | |
getFeature ( string $feature ) : string | Returns the current browser capability. | |
getHTTPProtocol ( ) : string | Returns the server protocol in use on the current server. | |
getIPAddress ( ) : string | Returns the IP address of the client. | |
getMajor ( ) : integer | Returns the current browser's major version. | |
getMinor ( ) : integer | Returns the current browser's minor version. | |
getPlatform ( ) : string | Returns the currently matched platform. | |
getQuirk ( string $quirk ) : string | Returns unique behavior for the current browser. | |
getVersion ( ) : string | Returns the current browser's version. | |
hasFeature ( string $feature ) : boolean | Checks the current browser capabilities. | |
hasQuirk ( string $quirk ) : boolean | Checks unique behavior for the current browser. | |
isBrowser ( string $browser ) : boolean | Determines if the given browser is the same as the current. | |
isMobile ( ) : boolean | Is the current browser to be a mobile device? | |
isRobot ( ) : boolean | Is the browser a robot? | |
isTablet ( ) : boolean | Is the current browser a tablet device? This is not 100% reliable, as most browsers do not differentiate between smartphone and tablet versions. | |
isViewable ( string $mimetype ) : boolean | Determines if a browser can display a given MIME type. | |
match ( string $userAgent = null, string $accept = null ) | Parses the user agent string and inititializes the object with all the known features and quirks for the given browser. | |
setBrowser ( string $browser ) | Sets the current browser. | |
setFeature ( string $feature, string $value = true ) | Sets capabilities for the current browser. | |
setMobile ( boolean $mobile ) | Set this browser as a mobile device. | |
setQuirk ( string $quirk, string $value = true ) | Sets unique behavior for the current browser. | |
setTablet ( boolean $tablet ) | Set this browser as a tablet device. | |
usingSSLConnection ( ) : boolean | Determines if we are using a secure (SSL) connection. | |
wasFileUploaded ( string $field, string $name = null ) | Determines if the file was uploaded or not. If not, will return the appropriate error message. |
Method | Description | |
---|---|---|
_setPlatform ( ) | Matches the platform of the browser. |
public __construct ( string $userAgent = null, string $accept = null ) | ||
$userAgent | string | The browser string to parse. |
$accept | string | The HTTP_ACCEPT settings to use. |
protected _setPlatform ( ) |
public static allowFileUploads ( ) : integer | ||
return | integer | If uploads allowed, returns the maximum size of the upload in bytes. Returns 0 if uploads are not allowed. |
public downloadHeaders ( string $filename = 'unknown', string $cType = null, boolean $inline = false, string $cLength = null ) | ||
$filename | string | The filename of the download. |
$cType | string | The content-type description of the file. |
$inline | boolean | True if inline, false if attachment. |
$cLength | string | The content-length of this file. |
public getAgentString ( ) : string | ||
return | string | The browser agent string. |
public getBrowser ( ) : string | ||
return | string | The current browser. |
public getFeature ( string $feature ) : string | ||
$feature | string | The capability to retrieve. |
return | string | The value of the requested capability. |
public getHTTPProtocol ( ) : string | ||
return | string | The HTTP server protocol version. |
public getIPAddress ( ) : string | ||
return | string | The client IP address. |
public getPlatform ( ) : string | ||
return | string | The user's platform. |
public getVersion ( ) : string | ||
return | string | The current browser's version. |
public hasFeature ( string $feature ) : boolean | ||
$feature | string | The capability to check. |
return | boolean | Does the browser have the capability set? |
public isViewable ( string $mimetype ) : boolean | ||
$mimetype | string | The MIME type to check. |
return | boolean | True if the browser can display the MIME type. |
public setBrowser ( string $browser ) | ||
$browser | string | The browser to set as current. |
public setFeature ( string $feature, string $value = true ) | ||
$feature | string | The capability to set. Features: - accesskey - ajax - cite - dataurl - dom - frames - hdml - html - homepage - iframes - images - ischrome - iskonqueror - issafari - java - javascript - optgroup - rte - tables - utf - wml - xmlhttpreq |
$value | string | Special capability parameter. |
public setQuirk ( string $quirk, string $value = true ) | ||
$quirk | string | The behavior to set. Quirks: - avoid_popup_windows - break_disposition_header - break_disposition_filename - broken_multipart_form - buggy_compression - cache_same_url - cache_ssl_downloads - double_linebreak_textarea - empty_file_input_value - must_cache_forms - no_filename_spaces - no_hidden_overflow_tables - ow_gui_1.3 - png_transparency - scrollbar_in_way - scroll_tds - windowed_controls |
$value | string | Special behavior parameter. |
public usingSSLConnection ( ) : boolean | ||
return | boolean | True if using SSL, false if not. |
public wasFileUploaded ( string $field, string $name = null ) | ||
$field | string | The name of the field containing the uploaded file. |
$name | string | The file description string to use in the error message. Default: 'file'. |
protected array $_images | ||
return | array |
protected string $_lowerAgent | ||
return | string |
protected int $_majorVersion | ||
return | integer |
protected int $_minorVersion | ||
return | integer |
protected $_mobileAgents |
protected string $_platform | ||
return | string |
protected string $_robotAgentRegexp | ||
return | string |