bug #33532 [HttpKernel] fix compat with legacy DebugClassLoader (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpKernel] fix compat with legacy DebugClassLoader
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
73198c6d51
[HttpKernel] fix compat with legacy DebugClassLoader
This commit is contained in:
commit
8ca975ddf4
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\HttpKernel\DependencyInjection;
|
namespace Symfony\Component\HttpKernel\DependencyInjection;
|
||||||
|
|
||||||
use Composer\Autoload\ClassLoader;
|
use Composer\Autoload\ClassLoader;
|
||||||
|
use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\ErrorHandler\DebugClassLoader;
|
use Symfony\Component\ErrorHandler\DebugClassLoader;
|
||||||
@ -90,7 +91,7 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($function[0] instanceof DebugClassLoader) {
|
if ($function[0] instanceof DebugClassLoader || $function[0] instanceof LegacyDebugClassLoader) {
|
||||||
$function = $function[0]->getClassLoader();
|
$function = $function[0]->getClassLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
|||||||
use Symfony\Component\Config\ConfigCache;
|
use Symfony\Component\Config\ConfigCache;
|
||||||
use Symfony\Component\Config\Loader\DelegatingLoader;
|
use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||||
|
use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
@ -544,7 +545,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
}
|
}
|
||||||
// Remove frames added by DebugClassLoader.
|
// Remove frames added by DebugClassLoader.
|
||||||
for ($i = \count($backtrace) - 2; 0 < $i; --$i) {
|
for ($i = \count($backtrace) - 2; 0 < $i; --$i) {
|
||||||
if (DebugClassLoader::class === ($backtrace[$i]['class'] ?? null)) {
|
if (\in_array($backtrace[$i]['class'] ?? null, [DebugClassLoader::class, LegacyDebugClassLoader::class], true)) {
|
||||||
$backtrace = [$backtrace[$i + 1]];
|
$backtrace = [$backtrace[$i + 1]];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user