Zend_Http_UserAgent-Features.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. <para>
  41. Options are defined on a per-adapter basis.
  42. </para>
  43. </sect2>
  44. <sect2 id="zend.http.user-agent-features.methods">
  45. <title>Available Methods</title>
  46. <variablelist>
  47. <varlistentry id="zend.http.user-agent-features.methods.get-from-request">
  48. <term>
  49. <methodsynopsis>
  50. <methodname>getFromRequest</methodname>
  51. <methodparam>
  52. <funcparams>array $request, array $config</funcparams>
  53. </methodparam>
  54. </methodsynopsis>
  55. </term>
  56. <listitem>
  57. <para>
  58. Decompose the request in order to return an array of device capabilities.
  59. </para>
  60. </listitem>
  61. </varlistentry>
  62. </variablelist>
  63. </sect2>
  64. </sect1>