Skip to content

use DebugClassLoader class from Debug component instead of the one from ... #3039

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions components/class_loader/debug_class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
Debugging a Class Loader
========================

The :class:`Symfony\\Component\\ClassLoader\\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 as easy as calling its static
:method:`Symfony\\Component\\ClassLoader\\DebugClassLoader::enable` method::

use Symfony\Component\ClassLoader\DebugClassLoader;

DebugClassLoader::enable();
Since Symfony 2.4, the ``DebugClassLoader`` of the Class Loader component is
deprecated. Use the
:doc:`DebugClassLoader provided by the Debug component </components/debug/class_loader>`.
22 changes: 22 additions & 0 deletions components/debug/class_loader.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. index::
single: Class Loader; DebugClassLoader
single: Debug; DebugClassLoader

Debugging a Class Loader
========================

.. versionadded:: 2.4
The ``DebugClassLoader`` of the Debug component is new in Symfony 2.4.
Previously, it was located in the Class Loader component.

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 as easy as calling its static
:method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method::

use Symfony\Component\ClassLoader\DebugClassLoader;

DebugClassLoader::enable();
8 changes: 8 additions & 0 deletions components/debug/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Debug
=====

.. toctree::
:maxdepth: 2

introduction
class_loader
5 changes: 2 additions & 3 deletions components/debug.rst → components/debug/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ Enabling them all is as easy as it can get::
Debug::enable();

The :method:`Symfony\\Component\\Debug\\Debug::enable` method registers an
error handler and an exception handler. If the :doc:`ClassLoader component
</components/class_loader/introduction>` is available, a special class loader
is also registered.
error handler, an exception handler and
:doc:`a special class loader </components/debug/class_loader>`.

Read the following sections for more information about the different available
tools.
Expand Down
2 changes: 1 addition & 1 deletion components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Components
config/index
console/index
css_selector
debug
debug/index
dependency_injection/index
dom_crawler
event_dispatcher/index
Expand Down
5 changes: 3 additions & 2 deletions components/map.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@

* :doc:`/components/css_selector`

* **Debug**
* :doc:`/components/debug/index`

* :doc:`/components/debug`
* :doc:`/components/debug/introduction`
* :doc:`/components/debug/class_loader`

* :doc:`/components/dependency_injection/index`

Expand Down
4 changes: 2 additions & 2 deletions cookbook/configuration/front_controllers_and_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ to `decorate`_ the kernel with additional features. Examples include:
* Configuring the autoloader or adding additional autoloading mechanisms;
* Adding HTTP level caching by wrapping the kernel with an instance of
:ref:`AppCache <symfony-gateway-cache>`;
* Enabling (or skipping) the :doc:`ClassCache </cookbook/debugging>`
* Enabling the :doc:`Debug component </components/debug>`.
* Enabling (or skipping) the :doc:`ClassCache </cookbook/debugging>`;
* Enabling the :doc:`Debug Component </components/debug/introduction>`.

The front controller can be chosen by requesting URLs like:

Expand Down