The following options may be passed to the constructor or within your application configuration. A "." indicates another layer of depth in the configuration array.
Each features adapter has its own options available as well, which may be mixed in with the general UserAgent options.
Used to seed the list of devices the component will search. See also
identification_sequence; this value will be prepended to that list during user agent device discovery.
The value of the
AcceptHTTP header; used by some user agents to determine capabilities. Set this to seed the value explicitly.
A comma-separated list of device types to scan for matches; defaults to "mobile,desktop".
The name of a storage adapter used to persist the device capabilities, typically within a given user session. The value may either be a fully qualified class name, or a short name to resolve by the plugin loader for storage classes. By default, uses "Session" as the value, resolving to
An array of options to pass to the constructor of a storage adapter. By default, the option
browser_typewill be present.
- plugin_loader.[type] = [class]
Plugin loader configuration; allows you to specify a pre-configured
Zend_Loader_PluginLoaderextension class to use for one of the plugin loader types managed by
UserAgent(currently "storage" and "device".
Typically, you will not set this; this simply allows injection of the
$_SERVERsuperglobal (or a filtered version of it). The value should be an associative array.
The actual HTTP User-Agent string you wish to try and match. Typically, this will be auto-discovered from the
The device class to use for a given browser type; typically,
browser_typewill be one of the supported browser devices, including:
browser_typeshould be normalized to lowercase for configuration purposes.
- [browser_type].device.path and [browser_type].device.prefix
An alternate way to specify the device class for a given browser type is to assume it is named after the device, and that all device classes are in the same path sharing the same prefix. Configure the prefix and path using these keys.
As an example, the following would look for a class named "Mobile_Device_Bot" on the path "Mobile/Device/" under the application library.
resources.useragent.bot.device.path = APPLICATION_PATH '/../library/Mobile/Device" resources.useragent.bot.device.prefix = "Mobile_Device"
- [browser_type].features.path and [browser_type].features.classname
These settings are used to load the features capabilities detection class for a given browser type. The class will be named using the
classnamekey, and is expected to exist in the file denoted by the
pathkey. The class should implement