Zend_Http_UserAgent-Storage.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.http.user-agent-storage">
  4. <title>The UserAgent Storage Interface</title>
  5. <sect2 id="zend.http.user-agent-storage.intro">
  6. <title>Overview</title>
  7. <para>
  8. Because discovering and identifying mobile device capabilities can involve a number of
  9. resources, it's often useful to identify the capabilities on the first visit, and cache
  10. it for subsequent visits.
  11. </para>
  12. <para>
  13. The <interfacename>Zend_Http_UserAgent_Storage</interfacename> interface provides a
  14. simple definition for defining storage adapters capable of persisting definitions. By
  15. default, a <classname>Session</classname> storage adapter is used, which persists the
  16. data in a <classname>Zend_Session_Namespace</classname> instance.
  17. </para>
  18. </sect2>
  19. <sect2 id="zend.http.user-agent-storage.quick-start">
  20. <title>Quick Start</title>
  21. <para>
  22. The interface provides simply the ability to read from, write to, test for, and clear
  23. data in the persistence backend.
  24. </para>
  25. <programlisting language="php"><![CDATA[
  26. interface Zend_Http_UserAgent_Storage
  27. {
  28. public function isEmpty();
  29. public function read();
  30. public function write($contents);
  31. public function clear();
  32. }
  33. ]]></programlisting>
  34. <para>
  35. By default, the <classname>Zend_Http_UserAgent_Storage_Session</classname> adapter is
  36. utilized. That adapter writes to a unique <classname>Zend_Session_Namespace</classname>
  37. for the given user.
  38. </para>
  39. </sect2>
  40. <sect2 id="zend.http.user-agent-storage.options">
  41. <title>Configuration Options</title>
  42. <para>
  43. See the individual storage adapters for configuration options. Most adapters will accept
  44. an array or object as an argument to the constructor, and the
  45. <classname>UserAgent</classname> class allows passing an array of options.
  46. </para>
  47. </sect2>
  48. <sect2 id="zend.http.user-agent-storage.methods">
  49. <title>Available Methods</title>
  50. <refentry id="zend.view.helpers.initial.tiny-src.methods.is-empty">
  51. <refnamediv>
  52. <refname>isEmpty</refname>
  53. <refpurpose>Test whether or not the storage adapter has an entry</refpurpose>
  54. </refnamediv>
  55. <refsynopsisdiv>
  56. <methodsynopsis>
  57. <methodname>isEmpty</methodname>
  58. </methodsynopsis>
  59. </refsynopsisdiv>
  60. <refsect1>
  61. <title>isEmpty()</title>
  62. <para>
  63. Test whether ornot the storage adapter has an entry. Returns true if the
  64. storage is currently unpopulated.
  65. </para>
  66. </refsect1>
  67. </refentry>
  68. <refentry id="zend.view.helpers.initial.tiny-src.methods.read">
  69. <refnamediv>
  70. <refname>read</refname>
  71. <refpurpose>Read data from storage</refpurpose>
  72. </refnamediv>
  73. <refsynopsisdiv>
  74. <methodsynopsis>
  75. <methodname>read</methodname>
  76. </methodsynopsis>
  77. </refsynopsisdiv>
  78. <refsect1>
  79. <title>read()</title>
  80. <para>
  81. Reads data from storage; the data will be serialized PHP.
  82. </para>
  83. </refsect1>
  84. </refentry>
  85. <refentry id="zend.view.helpers.initial.tiny-src.methods.write">
  86. <refnamediv>
  87. <refname>write</refname>
  88. <refpurpose>Write data to storage</refpurpose>
  89. </refnamediv>
  90. <refsynopsisdiv>
  91. <methodsynopsis>
  92. <methodname>write</methodname>
  93. <methodparam>
  94. <funcparams>$contents</funcparams>
  95. </methodparam>
  96. </methodsynopsis>
  97. </refsynopsisdiv>
  98. <refsect1>
  99. <title>write()</title>
  100. <para>
  101. Write a serialized string to the storage engine.
  102. </para>
  103. </refsect1>
  104. </refentry>
  105. <refentry id="zend.view.helpers.initial.tiny-src.methods.clear">
  106. <refnamediv>
  107. <refname>clear</refname>
  108. <refpurpose>Empty the storage</refpurpose>
  109. </refnamediv>
  110. <refsynopsisdiv>
  111. <methodsynopsis>
  112. <methodname>clear</methodname>
  113. </methodsynopsis>
  114. </refsynopsisdiv>
  115. <refsect1>
  116. <title>clear()</title>
  117. <para>
  118. Should empty the storage; calling <methodname>isEmpty()</methodname> following a
  119. <methodname>clear()</methodname> operation should return
  120. <constant>true</constant>.
  121. </para>
  122. </refsect1>
  123. </refentry>
  124. </sect2>
  125. </sect1>