UserAgent Options
The following options may be passed to the constructor or within your application configuration. A "." indicates another layer of depth in the configuration array; as an example, assigning "wurflapi.wurfl_config_array.wurfl.main-file" as part of a PHP configuration would require the following definition:
<?php
$config = array(
'wurflapi' => array(
'wurfl_config_array' => array(
'wurfl' => array(
'main-file' => 'path/to/some/file',
),
),
),
);
Each features adapter has its own options available as well, which may be mixed in with the general UserAgent options.
- browser_type
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.- http_accept
The value of the
AcceptHTTP header; used by some user agents to determine capabilities. Set this to seed the value explicitly.- identification_sequence
A comma-separated list of device types to scan for matches; defaults to "mobile,desktop".
- storage.adapter
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
Zend_Http_UserAgent_Storage_Session.- storage.options[]
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 byUserAgent(currently "storage" and "device".- server[]
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.- user_agent
The actual HTTP User-Agent string you wish to try and match. Typically, this will be auto-discovered from the
serverarray.- [browser_type].device.classname
-
The device class to use for a given browser type; typically,
browser_typewill be one of the supported browser devices, including:Bot
Checker
Console
Desktop
Email
Feed
Mobile
Offline
Probe
Spam
Text
Validator
The
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 thepathkey. The class should implementZend_Http_UserAgent_Features_Adapter.- wurflapi.wurfl_api_version
If using the WURFL API, use this key to specify which version you are using; typically, this will be either "1.0" or "1.1".
- wurflapi.wurfl_lib_dir
If using the WURFL API, use this key to specify in which directory the library exists.
- wurflapi.wurfl_config_file
If using the WURFL API, use this key to specify the location of the configuration file you will use; typically, this will be
resources/wurfl-config.phpwithin thewurfl_lib_dir.- wurflapi.wurfl_config_array.wurfl.main-file
If using version 1.1 of the WURFL API, you can omit using a
wurfl_config_file, and instead provide an associative array of configuration values. This particular value indicates the location of thewurfl.xmlfile containing the actual WURFL database.- wurflapi.wurfl_config_array.wurfl.patches[]
If using version 1.1 of the WURFL API, you can omit using a
wurfl_config_file, and instead provide an associative array of configuration values. This particular value is an array of file locations containing patchfiles for thewurfl.main-file(which are used to ammend and extend the primary database file).- wurflapi.wurfl_config_array.persistence.provider
If using version 1.1 of the WURFL API, you can omit using a
wurfl_config_file, and instead provide an associative array of configuration values. This particular value indicates the type of persistence provider used when caching discovered capabilities. See the WURFL documentation for potential values; "file" is a known good value.- wurflapi.wurfl_config_array.persistence.dir
If using version 1.1 of the WURFL API, you can omit using a
wurfl_config_file, and instead provide an associative array of configuration values. This particular value indicates the location where the persistence provider will cache discovered capabilities.




