Commit dab32597 authored by Fabien Potencier's avatar Fabien Potencier

minor #1633 Add note about ExceptionHandler in CLI (hkdobrev)

This PR was squashed before being merged into the 2.3.x-dev branch (closes #1633).

Discussion
----------

Add note about ExceptionHandler in CLI

Commits
-------

852b4fc2 Add note about ExceptionHandler in CLI
parents da5d5f67 852b4fc2
...@@ -36,3 +36,15 @@ the ``$debug`` argument:: ...@@ -36,3 +36,15 @@ the ``$debug`` argument::
use Symfony\Component\Debug\ExceptionHandler; use Symfony\Component\Debug\ExceptionHandler;
ExceptionHandler::register(false); ExceptionHandler::register(false);
.. note::
Important caveat when using Silex on a command-line interface:
The ``ExceptionHandler`` should not be enabled as it would convert an error
to HTML output and return a non-zero exit code::
use Symfony\Component\Debug\ExceptionHandler;
if (!in_array(PHP_SAPI, ['cli', 'phpdbg'])) {
ExceptionHandler::register();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment