Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_ProgessBar Component Proposal

Proposed Component Name Zend_ProgessBar
Developer Notes
Proposers Ben Scholzen
Zend Liaison Ralph Schindler
Revision 1.0 - 20 August 2008: Initial proposal.
2.0 - 06 September 2008: Refactoring from Zend_Console_ProgressBar to Zend_ProgressBar. (wiki revision: 10)

Table of Contents

1. Overview

Zend_ProgessBar is designed to give developers a simple option to display progess to the user in multiple enviroments. In the first stage, it will support a console adapter, which supports three elements, which are a percentage value, a bar, and an automatic calculated ETA, of which all can be custom arranged and partially leaved out. Another available adapter will be Comet, which serves the purpose of updating progressbars in the web.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will not be able to watch other classes (this would require some hacky multi-processing, which would not work on windows).
  • This component will automatically calculate an ETA.
  • This component will allow to set an additional status text.
  • The console adapter will work on both nix (linux, bsd, solaris, mac, etc) and win systems.
  • The console adapter will automatically try to determine the terminal width in auto mode.
  • The console adapter will allow setting a custom width.
  • The console adapter will allow to customize the style of the progressbar.
  • The comet adapter will allow updating a progressbar via javascript, while an action is running.

4. Dependencies on Other Framework Components

  • Zend_Exception
  • Zend_Json

5. Theory of Operation

First an instance of Zend_ProgessBar is created, with setting min-, max value (those default to 0 and 100), as well as a frontend adapter. After that the user can call the ::update($value, $text) method to update the progessbar.

6. Milestones / Tasks

  • Milestone 1: [DONE] Working prototype checked into the incubator.
  • Milestone 2: [DONE] Unit tests exist, work, and are checked into SVN.
  • Milestone 3: [DONE] Documentation exists.
  • Milestone 4: Component is approved and moved into trunk.

7. Class Index

  • Zend_ProgessBar
  • Zend_ProgessBar_Adapter_Interface
  • Zend_ProgessBar_Adapter_Console
  • Zend_ProgessBar_Adapter_Comet

8. Use Cases


9. Class Skeletons



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 26, 2008

    <p>Nice Package!</p>

    <p>I'd love to see an optional status-text-element, that displays a text beneath the bar, that can be updated, too.</p>

    <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
    ####----------------------------------------- Installing core translations
    #####---------------------------------------- Installing core registry

  2. Aug 26, 2008

    <p>Great component, it's perfect <ac:emoticon ac:name="wink" /></p>

    <p>As for it has been discussed thoroughly on irc already, it can be moved to incubator right-away <ac:emoticon ac:name="laugh" /></p>

  3. Sep 22, 2008

    <p>I think that I should rename the component to Zend_ProgressMeter, as ProgressBar just describes the bar-element itself, not all the stuff around it (ETA, absolute values, percentage, etc.). What do you think?</p>

    1. Sep 22, 2008

      <p>Technically spoken you may be right, as for Zend_ProgressMeter better describes the functionality of the component. However, because ProgressBar is so common and well-known, I think it would be more appropriate to keep it Zend_ProgressBar.</p>

      1. Sep 23, 2008

        <p>I agree with Dolf that the name Zend_ProgressBar suits this component.</p>

  4. Oct 10, 2008

    <p>I think it would make sense to have an indeterminate mode. The reason why this should not be considered out of scope for this component is that sometime indeterminately long work has to be done in the same operation as determinately long work. You therefore might want to show a percentage progress bar, then an indeterminate one, then a percentage one, etc. in the same style. The visualization of the indeterminate progress bar can be an old school <a href="">Cylon eye</a>. <ac:emoticon ac:name="smile" /><br />
    Also, what would the comet adapter look like? Would it have associated view helpers to render it?</p>

    1. Oct 10, 2008

      <p>The comet adapter doesnt has a view helper. The reason for that is, that the progress is usually done in after some event in the user browser, so it is fully created by JavaScript. At that point, a view helper doesn't has any effect. I could probalby create a view helper which directly loads a specific action (url) and creates a Dojo Progressbar, but that would (imho) be way to specific.</p>

      <p>As for the indeterminate mode: That would be possible with comet, to be more exacly with JavaScript (as it has nothing to do with actual progress), but not with the console adapter, as that would require multithreading, which is not there (one thread for the actual process and one thread for the progressbar animation).</p>

  5. Aug 16, 2010

    <p>I just added Zend PB into my project for some command line tools we have. It's really easy! Good work on this module.</p>

    <p>HOWEVER, there is one significant flaw: no setters for the "min" or "max" values. You can only set these in the constructor.</p>

    <p>This is a problem because it makes dependency injection very cumbersome. I would <strong>like</strong> to be able to pass a progress bar to a method so that the method doesn't instantiate its own progress bar (this would allow for a test double when unit testing), but my caller doesn't know what the "min" and "max" values are... only the callee knows that.</p>

    <p>Any chance of getting this updated?</p>