Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DebugClassLoader.php

function DebugClassLoader::enable

Wraps all autoloaders.

1 call to DebugClassLoader::enable()
Debug::enable in vendor/symfony/error-handler/Debug.php

File

vendor/symfony/error-handler/DebugClassLoader.php, line 184

Class

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

Namespace

Symfony\Component\ErrorHandler

Code

public static function enable() : void {
    // Ensures we don't hit https://bugs.php.net/42098
    class_exists(ErrorHandler::class);
    class_exists(\Psr\Log\LogLevel::class);
    if (!\is_array($functions = spl_autoload_functions())) {
        return;
    }
    foreach ($functions as $function) {
        spl_autoload_unregister($function);
    }
    foreach ($functions as $function) {
        if (!\is_array($function) || !$function[0] instanceof self) {
            $function = [
                new static($function),
                'loadClass',
            ];
        }
        spl_autoload_register($function);
    }
}
RSS feed
Powered by Drupal