Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] added ProgressBar (to replace the stateful ProgressHelper class)#10355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@fabpot
Copy link
Member

QA
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#9951, related to#9788
LicenseMIT
Doc PRn/a

TODO:

  • submit a PR on the docs

This PR deprecatedProgressHelper in favor ofProgressBar. The main difference is that the newProgressBar class is stateless, which allows for more than one bar to be displayed at a time:

useSymfony\Component\Console\Helper\ProgressBar;useSymfony\Component\Console\Output\ConsoleOutput;$output =newConsoleOutput();$bar1 =newProgressBar($output,10);$bar2 =newProgressBar($output,20);$bar2->setProgressCharacter('#');$bar1->start();print"\n";$bar2->start();for ($i =1;$i <=20;$i++) {// up one line$output->write("\033[1A");usleep(100000);if ($i <=10) {$bar1->advance();    }print"\n";$bar2->advance();}

And here is how it looks like when run:

progress-bars

@fabpot
Copy link
MemberAuthor

By the way, that also makes the progress bar part of the Console more easily reusable outside the context of a full console app/command.

@wouterj
Copy link
Member

Wouldn't it be nicer if there was a ProgressGroup or the like? There we can specify multiple progress bars and tell if it shoúld be placed horizontal or vertical. It would also handle the "moved one line up" things

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

integer for consistency

@cordovalcordoval mentioned this pull requestMar 1, 2014
1 task
@fabpot
Copy link
MemberAuthor

I don't think it would make sense to create a ProgressGroup as it won't bring much to the table (and would restrict what you could do).

@fabpot
Copy link
MemberAuthor

Closing for#10356 instead.

@fabpotfabpot closed thisMar 1, 2014
@fabpotfabpot deleted the progress-helper-stateless branchMarch 1, 2014 17:36
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@fabpot@wouterj@cordoval

[8]ページ先頭

©2009-2025 Movatter.jp