Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper.
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);
}
}