| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.http.user-agent-features">
- <title>The UserAgent Features Adapter</title>
- <sect2 id="zend.http.user-agent-features.intro">
- <title>Overview</title>
- <para>
- A variety of databases exist that define browser device features and capabilities.
- <classname>Zend_Http_UserAgent</classname> provides the ability to utilize the database
- of your choice via a features adapter interface.
- </para>
- <para>
- The features adapter is passed a request array that contains the User-Agent string and
- any other relevant HTTP headers and environment pertinent to detecting the device in
- use. Additionally, if any adapter-specific configuration might be needed, an additional
- configuration array will be provided. The adapter must then return an array of device
- capabilities.
- </para>
- </sect2>
- <sect2 id="zend.http.user-agent-features.quick-start">
- <title>Quick Start</title>
- <para>
- The adapter interface is quite simple, defining but the single static method
- <methodname>getFromRequest()</methodname>.
- </para>
- <programlisting language="php"><![CDATA[
- interface Zend_Http_UserAgent_Features_Adapter
- {
- /**
- * Retrieve the browser's features from a given request object ($_SERVER)
- *
- * @return array
- */
- public static function getFromRequest($request, array $config);
- }
- ]]></programlisting>
- </sect2>
- <sect2 id="zend.http.user-agent-features.options">
- <title>Configuration Options</title>
- <para>
- Options are defined on a per-adapter basis.
- </para>
- </sect2>
- <sect2 id="zend.http.user-agent-features.methods">
- <title>Available Methods</title>
- <refentry id="zend.http.user-agent-features.methods.get-from-request">
- <refnamediv>
- <refname>getFromRequest</refname>
- <refpurpose>Match a User-Agent to its capabilities</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <methodsynopsis>
- <methodname>getFromRequest</methodname>
- <methodparam>
- <funcparams>array $request, array $config</funcparams>
- </methodparam>
- </methodsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>getFromRequest()</title>
- <para>
- Decompose the request in order to return an array of device capabilities.
- </para>
- </refsect1>
- </refentry>
- </sect2>
- </sect1>
|