1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect3 id="zend.progressbar.adapter.console">
4 <title>Zend_ProgressBar_Adapter_Console</title>
7 <classname>Zend_ProgressBar_Adapter_Console</classname> is a text-based adapter
8 for terminals. It can automatically detect terminal widths but supports
9 custom widths as well. You can define which elements are displayed with
10 the progressbar and as well customize the order of them. You can also
11 define the style of the progressbar itself.
15 <title>Automatic console width recognition</title>
18 <code>shell_exec</code> is required for this feature to work on
19 *nix based systems. On windows, there is always a fixed terminal
20 width of 80 character, so no recognition is required there.
25 You can set the adapter options either via the <code>set*</code> methods
26 or give an array or a <classname>Zend_Config</classname> instance with options as first
27 parameter to the constructor. The available options are:
33 <code>outputStream</code>: A different output-stream, if you don't
34 want to stream to STDOUT. Can be any other stream like
35 <code>php://stderr</code> or a path to a file.
41 <code>width</code>: Either an integer or the <constant>AUTO</constant>
42 constant of <classname>Zend_Console_ProgressBar</classname>.
48 <code>elements</code>: Either <constant>NULL</constant> for default
49 or an array with at least one of the following constants
50 of <classname>Zend_Console_ProgressBar</classname> as value:
56 <constant>ELEMENT_PERCENT</constant>: The current value in percent.
62 <constant>ELEMENT_BAR</constant>: The visual bar which display
69 <constant>ELEMENT_ETA</constant>: The automatic calculated ETA.
70 This element is firstly displayed after five seconds,
71 because in this time, it is not able to calculate
78 <constant>ELEMENT_TEXT</constant>: An optional status message
79 about the current process.
87 <code>textWidth</code>: Width in characters of the
88 <constant>ELEMENT_TEXT</constant> element. Default is 20.
94 <code>charset</code>: Charset of the
95 <constant>ELEMENT_TEXT</constant> element. Default is utf-8.
101 <code>barLeftChar</code>: A string which is used left-hand
102 of the indicator in the progressbar.
108 <code>barRightChar</code>: A string which is used right-hand
109 of the indicator in the progressbar.
115 <code>barIndicatorChar</code>: A string which is used for
116 the indicator in the progressbar. This one can be empty.