Programmer's Reference Guide
| The UserAgent Storage Interface |
The Session UserAgent Storage Adapter
Overview
This storage adapter utilizes Zend_Session_Namespace for persisting discovered device capabilities for a given user session.
Quick Start
This particular storage adapter is used by default with Zend_Http_UserAgent. As such, you will benefit from it from the outset without any real configuration necessary.
You can alter the behavior slightly, however, by altering the namespace used, and the key (or member) in which data is written. You may do so by specifying the browser_type (mapped to namespace) and member options in your configuration.
- resources.useragent.storage.adapter = "Session"
- resources.useragent.storage.options.browser_type = "all"
- resources.useragent.storage.options.member = "data"
Typically, you will not pass the browser_type option, and instead let this be populated by the value discovered by the UserAgent class.
Configuration Options
-
- browser_type
-
Provide this in order to hardcode the session namespace in which you wish to store the User-Agent data. By default, the currently discovered browser type will be used, or, if not provided, the value "Zend_Http_UserAgent".
-
- member
-
This is the specific variable member within the session namespace in which the data will be stored. By default, the value "storage" will be used.
Session Storage Options
Available Methods
-
__construct (
$options = null ) -
Accepts an array or object containing options. See the configuration options section for details on the $options variable.
-
isEmpty
-
Used to determine whether or not the storage has been populated yet.
-
read
-
Retrieve previously stored data from the storage adapter.
-
write (
$contents ) -
Write data to the storage adapter for later retrieval. $contents should be a string containing the serialized UserAgent object.
-
clear
-
Clear the storage of any data.
| The UserAgent Storage Interface |
Select a Version
Languages Available
Components
Search the Manual
Navigation
- Zend Framework's Referenzhandbuch
- Zend Framework's Referenzhandbuch
- Zend Framework's Referenz
- Zend_Http
- Einführung
- Zend_Http_Client - Fortgeschrittende Nutzung
- Zend_Http_Client - Verbindungsadapter
- Zend_Http_Cookie und Zend_Http_CookieJar
- Zend_Http_Response
- Zend_Http_UserAgent
- The UserAgent Device Interface
- The UserAgent Features Adapter
- The WURFL UserAgent Features Adapter
- The DeviceAtlas UserAgent Features Adapter
- The TeraWurfl UserAgent Features Adapter
- The UserAgent Storage Interface
- The Session UserAgent Storage Adapter
