\Zend_Http_UserAgent
Lists of User Agent chains for testing :
- http://www.useragentstring.com/layout/useragentstring.php
- http://user-agent-string.info/list-of-ua
- http://www.user-agents.org/allagents.xml
- http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones
- http://www.mobilemultimedia.be/fr/
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Http_UserAgent
implements
Serializable
{
- // constants
- const DEFAULT_IDENTIFICATION_SEQUENCE = 'mobile,desktop';
- const DEFAULT_PERSISTENT_STORAGE_ADAPTER = 'Session';
- const DEFAULT_BROWSER_TYPE = 'desktop';
- const DEFAULT_HTTP_USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)';
- const DEFAULT_HTTP_ACCEPT = "application/xhtml+xml";
- const DEFAULT_MARKUP_LANGUAGE = "xhtml";
- // members
- protected $_browserType;
- protected array $_browserTypeClass = ;
- protected array $_config = ;
- protected Zend_Http_UserAgent_Device $_device;
- protected bool $_immutable = false;
- protected array $_loaders = ;
- protected array $_loaderTypes = ;
- protected array $_matchLog = ;
- protected $_server;
- protected Zend_Http_UserAgent_Storage $_storage;
- // methods
- public void __construct()
- public string serialize()
- public void unserialize()
- public Zend_Http_UserAgent setOptions()
- protected bool _match()
- protected string _getUserAgentDevice()
- public string getUserAgent()
- public Zend_Http_UserAgent setUserAgent()
- public string getHttpAccept()
- public Zend_Http_UserAgent setHttpAccept()
- public Zend_Http_UserAgent_Storage getStorage()
- public Zend_Http_UserAgent setStorage()
- public void clearStorage()
- public array getConfig()
- public Zend_Http_UserAgent setConfig()
- public Zend_Http_UserAgent_Device getDevice()
- public string getBrowserType()
- public Zend_Http_UserAgent setBrowserType()
- public array getServer()
- public void setServer()
- public mixed getServerValue()
- public void setServerValue()
- public Zend_Http_UserAgent setPluginLoader()
- public Zend_Loader_PluginLoader getPluginLoader()
- protected string _validateLoaderType()
- protected Zend_Http_UserAgent_Result _matchUserAgent()
- protected void _createDevice()
Hierarchy
Implements
Constants
Name | Value |
---|---|
DEFAULT_IDENTIFICATION_SEQUENCE | 'mobile,desktop' |
DEFAULT_PERSISTENT_STORAGE_ADAPTER | 'Session' |
DEFAULT_BROWSER_TYPE | 'desktop' |
DEFAULT_HTTP_USER_AGENT | 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' |
DEFAULT_HTTP_ACCEPT | "application/xhtml+xml" |
DEFAULT_MARKUP_LANGUAGE | "xhtml" |
Members
protected
- $_browserType
—
string
Browser type - $_browserTypeClass
—
array
Browser type class - $_config
—
array
Array to store config - $_device
—
Zend_Http_UserAgent_Device
Identified device - $_immutable
—
bool
Whether or not this instance is immutable. - $_loaderTypes
—
array
Valid plugin loader types - $_loaders
—
array
Plugin loaders - $_matchLog
—
array
Trace of items matched to identify the browser type - $_server
—
array
Server variable - $_storage
—
Zend_Http_UserAgent_Storage
Persistent storage handler
Methods
protected
- _createDevice() — Creates device object instance
- _getUserAgentDevice() — Loads class for a user agent device
- _match() — Comparison of the UserAgent chain and browser signatures.
- _matchUserAgent() — Run the identification sequence to match the right browser type according to the user agent
- _validateLoaderType() — Validate a plugin loader type
public
- __construct() — Constructor
- clearStorage() — Clean the persistent storage
- getBrowserType() — Retrieve the browser type
- getConfig() — Get user configuration
- getDevice() — Returns the device object
- getHttpAccept() — Returns the HTTP Accept server param
- getPluginLoader() — Get a plugin loader
- getServer() — Retrieve the "$_SERVER" array
- getServerValue() — Retrieve a server value
- getStorage() — Returns the persistent storage handler
- getUserAgent() — Returns the User Agent value
- serialize() — Serialized representation of the object
- setBrowserType() — Set the browser "type"
- setConfig() — Config parameters is an Array or a Zend_Config object
- setHttpAccept() — Force or replace the HTTP_ACCEPT chain in self::$_server variable
- setOptions() — Configure instance
- setPluginLoader() — Set plugin loader
- setServer() — Set the "$_SERVER" array
- setServerValue() — Set a server value
- setStorage() — Sets the persistent storage handler
- setUserAgent() — Force or replace the UA chain in $_server variable
- unserialize() — Unserialize a previous representation of the object