public static function DebugClassLoader::enable

Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper.

1 call to DebugClassLoader::enable()
Kernel::init in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php

File

drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php, line 45

Class

DebugClassLoader
Autoloader checking if the class is really defined in the file found.

Namespace

Symfony\Component\ClassLoader

Code

public static function enable() {
  if (!is_array($functions = spl_autoload_functions())) {
    return;
  }
  foreach ($functions as $function) {
    spl_autoload_unregister($function);
  }
  foreach ($functions as $function) {
    if (is_array($function) && method_exists($function[0], 'findFile')) {
      $function = array(
        new static($function[0]),
        'loadClass',
      );
    }
    spl_autoload_register($function);
  }
}