From bd47dedb1df6f712016e2a62474b83e87fd247ab Mon Sep 17 00:00:00 2001 From: Wouter J Date: Sat, 23 Nov 2019 12:55:37 +0100 Subject: [PATCH] Removed the Debug component --- _build/redirection_map | 1 + components/class_loader.rst | 9 +- .../class_loader/debug_class_loader.rst | 7 +- components/debug.rst | 89 ------------------- .../front_controllers_and_kernel.rst | 3 +- 5 files changed, 12 insertions(+), 97 deletions(-) delete mode 100644 components/debug.rst diff --git a/_build/redirection_map b/_build/redirection_map index bcf25257c6e..681f00f5b99 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -368,3 +368,4 @@ /introduction/from_flat_php_to_symfony2 /introduction/from_flat_php_to_symfony /contributing/community/other /contributing/community /setup/composer /setup +/components/debug https://github.com/symfony/debug diff --git a/components/class_loader.rst b/components/class_loader.rst index d4a279fe6be..ca27db3663b 100644 --- a/components/class_loader.rst +++ b/components/class_loader.rst @@ -34,10 +34,10 @@ Additionally, the Symfony ClassLoader component ships with a wrapper class which makes it possible :doc:`to cache the results of a class loader `. -When using the :doc:`Debug component `, you -can also use a special :ref:`DebugClassLoader ` -that eases debugging by throwing more helpful exceptions when a class could -not be found by a class loader. +When using the `Debug component`_, you can also use a special +:class:`Symfony\\Component\\Debug\\DebugClassLoader` that eases debugging by +throwing more helpful exceptions when a class could not be found by a class +loader. Installation ------------ @@ -68,6 +68,7 @@ Learn More class_loader/cache_class_loader +.. _Debug component: https://github.com/symfony/debug .. _PSR-0: https://www.php-fig.org/psr/psr-0/ .. _PSR-4: https://www.php-fig.org/psr/psr-4/ .. _`autoloading mechanism`: https://php.net/manual/en/language.oop5.autoload.php diff --git a/components/class_loader/debug_class_loader.rst b/components/class_loader/debug_class_loader.rst index 1bd3446af27..f60a726b3a4 100644 --- a/components/class_loader/debug_class_loader.rst +++ b/components/class_loader/debug_class_loader.rst @@ -3,6 +3,7 @@ Debugging a Class Loader .. caution:: - The ``DebugClassLoader`` from the ClassLoader component was deprecated - in Symfony 2.5 and removed in Symfony 3.0. Use the - :ref:`DebugClassLoader provided by the Debug component `. + The ``DebugClassLoader`` from the ClassLoader component was deprecated in + Symfony 2.5 and removed in Symfony 3.0. Use the + :class:`Symfony\\Component\\Debug\\DebugClassLoader` provided by the Debug + component. diff --git a/components/debug.rst b/components/debug.rst deleted file mode 100644 index ecaa1f4e755..00000000000 --- a/components/debug.rst +++ /dev/null @@ -1,89 +0,0 @@ -.. index:: - single: Debug - single: Components; Debug - -The Debug Component -=================== - - The Debug component provides tools to ease debugging PHP code. - -Installation ------------- - -.. code-block:: terminal - - $ composer require symfony/debug:^3.4 - -.. include:: /components/require_autoload.rst.inc - -Usage ------ - -The Debug component provides several tools to help you debug PHP code. -Enabling them all by calling this method:: - - use Symfony\Component\Debug\Debug; - - Debug::enable(); - -The :method:`Symfony\\Component\\Debug\\Debug::enable` method registers an -error handler, an exception handler and -:ref:`a special class loader `. - -Read the following sections for more information about the different available -tools. - -.. caution:: - - You should never enable the debug tools, except for the error handler, in a - production environment as they might disclose sensitive information to the user. - -Enabling the Error Handler --------------------------- - -The :class:`Symfony\\Component\\Debug\\ErrorHandler` class catches PHP errors -and converts them to exceptions (of class :phpclass:`ErrorException` or -:class:`Symfony\\Component\\Debug\\Exception\\FatalErrorException` for PHP -fatal errors):: - - use Symfony\Component\Debug\ErrorHandler; - - ErrorHandler::register(); - -This error handler is enabled by default in the production environment when the -application uses the FrameworkBundle because it generates better error logs. - -Enabling the Exception Handler ------------------------------- - -The :class:`Symfony\\Component\\Debug\\ExceptionHandler` class catches -uncaught PHP exceptions and converts them to a nice PHP response. It is useful -in debug mode to replace the default PHP/Xdebug output with something prettier -and more useful:: - - use Symfony\Component\Debug\ExceptionHandler; - - ExceptionHandler::register(); - -.. note:: - - If the :doc:`HttpFoundation component ` is - available, the handler uses a Symfony Response object; if not, it falls - back to a regular PHP response. - -.. _component-debug-class-loader: - -Debugging a Class Loader ------------------------- - -The :class:`Symfony\\Component\\Debug\\DebugClassLoader` attempts to -throw more helpful exceptions when a class isn't found by the registered -autoloaders. All autoloaders that implement a ``findFile()`` method are replaced -with a ``DebugClassLoader`` wrapper. - -Using the ``DebugClassLoader`` is done by calling its static -:method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method:: - - use Symfony\Component\Debug\DebugClassLoader; - - DebugClassLoader::enable(); diff --git a/configuration/front_controllers_and_kernel.rst b/configuration/front_controllers_and_kernel.rst index 73998666b7f..178c9daaf2d 100644 --- a/configuration/front_controllers_and_kernel.rst +++ b/configuration/front_controllers_and_kernel.rst @@ -46,7 +46,7 @@ to `decorate`_ the kernel with additional features. Examples include: * Adding HTTP level caching by wrapping the kernel with an instance of :ref:`AppCache `; * Enabling (or skipping) the :doc:`ClassCache `; -* Enabling the :doc:`Debug Component `. +* Enabling the `Debug component`_. The front controller can be chosen by requesting URLs like: @@ -158,6 +158,7 @@ loading the ``app/config/config_*environment*.yml`` file. You are free to implement this method differently if you need a more sophisticated way of loading your configuration. +.. _Debug component: https://github.com/symfony/debug .. _front controller: https://en.wikipedia.org/wiki/Front_Controller_pattern .. _Symfony Standard Edition: https://github.com/symfony/symfony-standard .. _app.php: https://github.com/symfony/symfony-standard/blob/master/web/app.php