Thanks again, it worked perfectly. I made the mistake of assuming that the text element would be there by default because the documentation for a related property "textWidth" said it defaulted to 20 characters. I should have read the section about the elements though.
-- Hector On Wed, Dec 30, 2009 at 8:31 AM, Hector Virgen <[email protected]> wrote: > Thanks! I must have overlooked that :) > > -- > Hector > > > > On Wed, Dec 30, 2009 at 7:40 AM, Michael "Ray" Rehbein < > [email protected]> wrote: > >> You want to set the 'elements' option of the adapter. >> >> http://framework.zend.com/manual/en/zend.progressbar.html#zend.progressbar.adapter.console >> >> $pbAdapter = new Zend_ProgressBar_Adapter_Console(array('elements'=> >> array(Zend_ProgressBar_Adapter_Console::ELEMENT_PERCENT, >> >> Zend_ProgressBar_Adapter_Console::ELEMENT_BAR, >> >> Zend_ProgressBar_Adapter_Console::ELEMENT_ETA, >> >> Zend_ProgressBar_Adapter_Console::ELEMENT_TEXT))); >> $progressBar = new Zend_ProgressBar($pbAdapter, 0, 10); >> >> for ($i = 0; $i < 10; $i++) { >> sleep(1); >> $progressBar->update($i, "Iteration: {$i}"); >> } >> $progressBar->finish(); >> >> On Tue, Dec 29, 2009 at 2:00 PM, Hector Virgen <[email protected]> >> wrote: >> > Hello, >> > I'm using Zend_ProgressBar (ZF 1.9.3) with the Console adapter. It's >> working >> > fine, except the $text argument of Zend_ProgressBar#update() is not >> > appearing anywhere on the screen. Here's my code (simplified): >> > $pbAdapter = new Zend_ProgressBar_Adapter_Console(); >> > $progressBar = new Zend_ProgressBar($pbAdapter, 0, 10); >> > for ($i = 0; $i < 10; $i++) { >> > sleep(1); >> > $progressBar->update($i, "Iteration: {$i}"); >> > } >> > $progressBar->finish(); >> > >> > When I run this from the console, the progress bar correctly fills over >> 10 >> > seconds, but the text "Iteration: #" does not appear anywhere. Is there >> > something I need to do in order to show the text? >> > -- >> > Hector >> > >> > >
