Zend_Http_UserAgent-Features.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.http.user-agent-features">
  4. <title>The UserAgent Features Adapter</title>
  5. <sect2 id="zend.http.user-agent-features.intro">
  6. <title>Overview</title>
  7. <para>
  8. A variety of databases exist that define browser device features and capabilities.
  9. <classname>Zend_Http_UserAgent</classname> provides the ability to utilize the database
  10. of your choice via a features adapter interface.
  11. </para>
  12. <para>
  13. The features adapter is passed a request array that contains the User-Agent string and
  14. any other relevant HTTP headers and environment pertinent to detecting the device in
  15. use. Additionally, if any adapter-specific configuration might be needed, an additional
  16. configuration array will be provided. The adapter must then return an array of device
  17. capabilities.
  18. </para>
  19. </sect2>
  20. <sect2 id="zend.http.user-agent-features.quick-start">
  21. <title>Quick Start</title>
  22. <para>
  23. The adapter interface is quite simple, defining but the single static method
  24. <methodname>getFromRequest()</methodname>.
  25. </para>
  26. <programlisting language="php"><![CDATA[
  27. interface Zend_Http_UserAgent_Features_Adapter
  28. {
  29. /**
  30. * Retrieve the browser's features from a given request object ($_SERVER)
  31. *
  32. * @return array
  33. */
  34. public static function getFromRequest($request, array $config);
  35. }
  36. ]]></programlisting>
  37. </sect2>
  38. <sect2 id="zend.http.user-agent-features.options">
  39. <title>Configuration Options</title>
  40. <variablelist>
  41. <title>Features Adapter Options</title>
  42. <para>
  43. Options are defined on a per-adapter basis.
  44. </para>
  45. </sect2>
  46. <sect2 id="zend.http.user-agent-features.methods">
  47. <title>Available Methods</title>
  48. <refentry id="zend.http.user-agent-features.methods.get-from-request">
  49. <refnamediv>
  50. <refname>getFromRequest</refname>
  51. <refpurpose>Match a User-Agent to its capabilities</refpurpose>
  52. </refnamediv>
  53. <refsynopsisdiv>
  54. <methodsynopsis>
  55. <methodname>getFromRequest</methodname>
  56. <methodparam>
  57. <funcparams>array $request, array $config</funcparams>
  58. </methodparam>
  59. </methodsynopsis>
  60. </refsynopsisdiv>
  61. <refsect1>
  62. <title>getFromRequest()</title>
  63. <para>
  64. Decompose the request in order to return an array of device capabilities.
  65. </para>
  66. </refsect1>
  67. </refentry>
  68. </sect2>
  69. </sect1>