Skip to content

Commit

Permalink
[#2352] Minor tweaks to new console events section
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Mar 30, 2013
1 parent c7c215f commit 5e502ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions components/console/events.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. index::
single: Console; Events

.. versionadded:: 2.3
The feature described in this chapter was added in 2.3.

Using Events
============

.. versionadded:: 2.3
Console events were added in Symfony 2.3.

The Application class of the Console component allows you to optionally hook
into the lifecycle of a console application via events. Instead of reinventing
the wheel, it uses the Symfony EventDispatcher component to do the work::
Expand All @@ -18,7 +18,7 @@ the wheel, it uses the Symfony EventDispatcher component to do the work::
$application->setDispatcher($dispatcher);
$application->run();

The ``ConsoleEvents::COMMAND`` event
The ``ConsoleEvents::COMMAND`` Event
------------------------------------

**Typical Purposes**: Doing something before any command is run (like logging
Expand Down Expand Up @@ -57,8 +57,8 @@ been executed.

After the command has been executed, the ``ConsoleEvents::TERMINATE`` event is
dispatched. It can be used to do any actions that need to be executed for all
commands or to cleanup what you initiated in the ``ConsoleEvents::COMMAND``
command (like sending logs, closing a database connection, sending emails,
commands or to cleanup what you initiated in a ``ConsoleEvents::COMMAND``
listener (like sending logs, closing a database connection, sending emails,
...). A listener might also change the exit code.

Listeners receive a
Expand Down Expand Up @@ -94,7 +94,7 @@ The ``ConsoleEvents::EXCEPTION`` event
command.

Whenever an exception is thrown by a command, the ``ConsoleEvents::EXCEPTION``
command is dispatched. A listener can wrap or change the exception or do
event is dispatched. A listener can wrap or change the exception or do
anything useful before the exception is thrown by the application.

Listeners receive a
Expand Down
2 changes: 1 addition & 1 deletion components/console/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Console
introduction
usage
single_command_tool
helpers/index
events
helpers/index
1 change: 1 addition & 0 deletions components/map.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* :doc:`/components/console/introduction`
* :doc:`/components/console/usage`
* :doc:`/components/console/single_command_tool`
* :doc:`/components/console/events`
* :doc:`/components/console/helpers/index`

* **CSS Selector**
Expand Down

0 comments on commit 5e502ea

Please sign in to comment.