Zend_ProgressBar_Adapter_Console.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect3 id="zend.progressbar.adapter.console">
  4. <title>Zend_ProgressBar_Adapter_Console</title>
  5. <para>
  6. <classname>Zend_ProgressBar_Adapter_Console</classname> is a text-based adapter
  7. for terminals. It can automatically detect terminal widths but supports
  8. custom widths as well. You can define which elements are displayed with
  9. the progressbar and as well customize the order of them. You can also
  10. define the style of the progressbar itself.
  11. </para>
  12. <note>
  13. <title>Automatic console width recognition</title>
  14. <para>
  15. <code>shell_exec</code> is required for this feature to work on
  16. *nix based systems. On windows, there is always a fixed terminal
  17. width of 80 character, so no recognition is required there.
  18. </para>
  19. </note>
  20. <para>
  21. You can set the adapter options either via the <code>set*</code> methods
  22. or give an array or a <classname>Zend_Config</classname> instance with options as first
  23. parameter to the constructor. The available options are:
  24. </para>
  25. <itemizedlist>
  26. <listitem>
  27. <para>
  28. <code>outputStream</code>: A different output-stream, if you don't
  29. want to stream to STDOUT. Can be any other stream like
  30. <code>php://stderr</code> or a path to a file.
  31. </para>
  32. </listitem>
  33. <listitem>
  34. <para>
  35. <code>width</code>: Either an integer or the <constant>AUTO</constant>
  36. constant of <classname>Zend_Console_ProgressBar</classname>.
  37. </para>
  38. </listitem>
  39. <listitem>
  40. <para>
  41. <code>elements</code>: Either <constant>NULL</constant> for default
  42. or an array with at least one of the following constants
  43. of <classname>Zend_Console_ProgressBar</classname> as value:
  44. </para>
  45. <itemizedlist>
  46. <listitem>
  47. <para>
  48. <constant>ELEMENT_PERCENT</constant>: The current value in percent.
  49. </para>
  50. </listitem>
  51. <listitem>
  52. <para>
  53. <constant>ELEMENT_BAR</constant>: The visual bar which display
  54. the percentage.
  55. </para>
  56. </listitem>
  57. <listitem>
  58. <para>
  59. <constant>ELEMENT_ETA</constant>: The automatic calculated ETA.
  60. This element is firstly displayed after five seconds,
  61. because in this time, it is not able to calculate
  62. accurate results.
  63. </para>
  64. </listitem>
  65. <listitem>
  66. <para>
  67. <constant>ELEMENT_TEXT</constant>: An optional status message
  68. about the current process.
  69. </para>
  70. </listitem>
  71. </itemizedlist>
  72. </listitem>
  73. <listitem>
  74. <para>
  75. <code>textWidth</code>: Width in characters of the
  76. <constant>ELEMENT_TEXT</constant> element. Default is 20.
  77. </para>
  78. </listitem>
  79. <listitem>
  80. <para>
  81. <code>charset</code>: Charset of the
  82. <constant>ELEMENT_TEXT</constant> element. Default is utf-8.
  83. </para>
  84. </listitem>
  85. <listitem>
  86. <para>
  87. <code>barLeftChar</code>: A string which is used left-hand
  88. of the indicator in the progressbar.
  89. </para>
  90. </listitem>
  91. <listitem>
  92. <para>
  93. <code>barRightChar</code>: A string which is used right-hand
  94. of the indicator in the progressbar.
  95. </para>
  96. </listitem>
  97. <listitem>
  98. <para>
  99. <code>barIndicatorChar</code>: A string which is used for
  100. the indicator in the progressbar. This one can be empty.
  101. </para>
  102. </listitem>
  103. </itemizedlist>
  104. </sect3>
  105. <!--
  106. vim:se ts=4 sw=4 et:
  107. -->