Debugging a Class Loader

Version: 2.5
Edit this page

Warning: You are browsing the documentation for Symfony 2.5, which is no longer maintained.

Read the updated version of this page for Symfony 6.0 (the current stable version).

Debugging a Class Loader

New in version 2.4

The DebugClassLoader of the Debug component was introduced in Symfony 2.4. Previously, it was located in the ClassLoader component.

The 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 enable() method:

use Symfony\Component\Debug\DebugClassLoader;

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.