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

added documentation for the dispatchable console application#2352

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

Merged
weaverryan merged 1 commit intosymfony:masterfromfabpot:console-events
Mar 30, 2013

Conversation

@fabpot
Copy link
Member

QA
Doc fix?yes
New docs?yes (symfony/symfony#7466)
Applies tomaster
Fixed ticketsn/a

Copy link
Contributor

Choose a reason for hiding this comment

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

should it beConsoleEvents::COMMAND rather than the value ? (same goes for the code)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed in the code

Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be only in the code ?console.code is an implementation detail that should not be exposed to end user I think.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

If it were just me, I would remove the constants altogether. I've followed what was done in the docs for HttpKernel.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think they're nice because:

  • they allow autocompletion,
  • magic values are bad (as seen on several other PRs)

Anyway, the current documentation is a bad compromise. If I were you I would pick one or the other way, not a weird mix.

Copy link
Contributor

Choose a reason for hiding this comment

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

And of course a typo in a constant name would produce an error while a typo in a magic value would cause a sometime hard to debug issue.

fabpot added a commit to symfony/symfony that referenced this pull requestMar 25, 2013
This PR was merged into the master branch.Discussion----------Console dispatcher| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#3889,#6124| License       | MIT| Doc PR        |symfony/symfony-docs#2352refs#1884,#1929This is an alternative implementation for adding events to console applications.This implementation has the following features:* Available for anyone using the Console component and it is not tied to  FrameworkBundle (this is important as one thing we are trying to solve is  email sending from a command, and frameworks like Silex using the Console  component needs a solution too);* Non-intrusive as the current code has not been changed (except for renaming  an internal variable that was wrongly named -- so that's not strictly needed  for this PR)* The new DispatchableApplication class also works without a dispatcher,  falling back to the regular behavior. That makes easy to create applications  that can benefit from a dispatcher when available, but can still work  otherwise.* Besides the *before* and *after* events, there is also an *exception* event  that is dispatched whenever an exception is thrown.* Each event is quite powerful and can manipulate the input, the output, but  also the command to be executed.Commits-------4f9a55a refactored the implementation of how a console application can handle events4edf29d added helperSet to console event objectsf224102 Added events for CLI commands
fabpot added a commit to symfony/console that referenced this pull requestMar 25, 2013
This PR was merged into the master branch.Discussion----------Console dispatcher| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #3889, #6124| License       | MIT| Doc PR        |symfony/symfony-docs#2352refs #1884, #1929This is an alternative implementation for adding events to console applications.This implementation has the following features:* Available for anyone using the Console component and it is not tied to  FrameworkBundle (this is important as one thing we are trying to solve is  email sending from a command, and frameworks like Silex using the Console  component needs a solution too);* Non-intrusive as the current code has not been changed (except for renaming  an internal variable that was wrongly named -- so that's not strictly needed  for this PR)* The new DispatchableApplication class also works without a dispatcher,  falling back to the regular behavior. That makes easy to create applications  that can benefit from a dispatcher when available, but can still work  otherwise.* Besides the *before* and *after* events, there is also an *exception* event  that is dispatched whenever an exception is thrown.* Each event is quite powerful and can manipulate the input, the output, but  also the command to be executed.Commits-------4f9a55a refactored the implementation of how a console application can handle events4edf29d added helperSet to console event objectsf224102 Added events for CLI commands
@wouterj
Copy link
Member

@weaverryan this is ready for merging as the code is merged

@fabpot
Copy link
MemberAuthor

I've just changed all event name to use constants. Mergeable now.

weaverryan added a commit that referenced this pull requestMar 30, 2013
added documentation for the dispatchable console application
@weaverryanweaverryan merged commitc7c215f intosymfony:masterMar 30, 2013
@weaverryan
Copy link
Member

Great new feature and well-explained!

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.

5 participants

@fabpot@wouterj@weaverryan@vicb@stof

[8]ページ先頭

©2009-2025 Movatter.jp