| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect3 id="zend.progressbar.adapter.console">
- <title>Zend_ProgressBar_Adapter_Console</title>
- <para>
- <classname>Zend_ProgressBar_Adapter_Console</classname> is a text-based adapter
- for terminals. It can automatically detect terminal widths but supports
- custom widths as well. You can define which elements are displayed with
- the progressbar and as well customize the order of them. You can also
- define the style of the progressbar itself.
- </para>
- <note>
- <title>Automatic console width recognition</title>
- <para>
- <code>shell_exec</code> is required for this feature to work on
- *nix based systems. On windows, there is always a fixed terminal
- width of 80 character, so no recognition is required there.
- </para>
- </note>
- <para>
- You can set the adapter options either via the <code>set*</code> methods
- or give an array or a <classname>Zend_Config</classname> instance with options as first
- parameter to the constructor. The available options are:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <code>outputStream</code>: A different output-stream, if you don't
- want to stream to STDOUT. Can be any other stream like
- <code>php://stderr</code> or a path to a file.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>width</code>: Either an integer or the <constant>AUTO</constant>
- constant of <classname>Zend_Console_ProgressBar</classname>.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>elements</code>: Either <constant>NULL</constant> for default
- or an array with at least one of the following constants
- of <classname>Zend_Console_ProgressBar</classname> as value:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <constant>ELEMENT_PERCENT</constant>: The current value in percent.
- </para>
- </listitem>
- <listitem>
- <para>
- <constant>ELEMENT_BAR</constant>: The visual bar which display
- the percentage.
- </para>
- </listitem>
- <listitem>
- <para>
- <constant>ELEMENT_ETA</constant>: The automatic calculated ETA.
- This element is firstly displayed after five seconds,
- because in this time, it is not able to calculate
- accurate results.
- </para>
- </listitem>
- <listitem>
- <para>
- <constant>ELEMENT_TEXT</constant>: An optional status message
- about the current process.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>
- <code>textWidth</code>: Width in characters of the
- <constant>ELEMENT_TEXT</constant> element. Default is 20.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>charset</code>: Charset of the
- <constant>ELEMENT_TEXT</constant> element. Default is utf-8.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>barLeftChar</code>: A string which is used left-hand
- of the indicator in the progressbar.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>barRightChar</code>: A string which is used right-hand
- of the indicator in the progressbar.
- </para>
- </listitem>
- <listitem>
- <para>
- <code>barIndicatorChar</code>: A string which is used for
- the indicator in the progressbar. This one can be empty.
- </para>
- </listitem>
- </itemizedlist>
- </sect3>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|