|
12 | 12 | use Sentry\SentryBundle\EventListener\RequestListenerResponseEvent;
|
13 | 13 | use Sentry\SentryBundle\EventListener\RequestListenerTerminateEvent;
|
14 | 14 | use Sentry\SentryBundle\EventListener\SubRequestListenerRequestEvent;
|
| 15 | +use Sentry\SentryBundle\Tracing\Cache\TraceableCacheAdapter; |
| 16 | +use Sentry\SentryBundle\Tracing\Cache\TraceableCacheAdapterForV2; |
| 17 | +use Sentry\SentryBundle\Tracing\Cache\TraceableCacheAdapterForV3; |
| 18 | +use Sentry\SentryBundle\Tracing\Cache\TraceableTagAwareCacheAdapter; |
| 19 | +use Sentry\SentryBundle\Tracing\Cache\TraceableTagAwareCacheAdapterForV2; |
| 20 | +use Sentry\SentryBundle\Tracing\Cache\TraceableTagAwareCacheAdapterForV3; |
15 | 21 | use Sentry\SentryBundle\Tracing\Doctrine\DBAL\Compatibility\MiddlewareInterface;
|
16 | 22 | use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverForV2;
|
17 | 23 | use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverForV3;
|
18 | 24 | use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingStatementForV2;
|
19 | 25 | use Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingStatementForV3;
|
| 26 | +use Symfony\Component\Cache\Adapter\AdapterInterface; |
| 27 | +use Symfony\Component\Cache\DoctrineProvider; |
20 | 28 | use Symfony\Component\HttpKernel\Event\ControllerEvent;
|
21 | 29 | use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
22 | 30 | use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
|
@@ -79,6 +87,26 @@ class_alias(GetResponseEvent::class, SubRequestListenerRequestEvent::class);
|
79 | 87 | }
|
80 | 88 | }
|
81 | 89 |
|
| 90 | +if (interface_exists(AdapterInterface::class)) { |
| 91 | + if (!class_exists(DoctrineProvider::class, false) && version_compare(\PHP_VERSION, '8.0.0', '>=')) { |
| 92 | + if (!class_exists(TraceableCacheAdapter::class, false)) { |
| 93 | + class_alias(TraceableCacheAdapterForV3::class, TraceableCacheAdapter::class); |
| 94 | + } |
| 95 | + |
| 96 | + if (!class_exists(TraceableTagAwareCacheAdapter::class, false)) { |
| 97 | + class_alias(TraceableTagAwareCacheAdapterForV3::class, TraceableTagAwareCacheAdapter::class); |
| 98 | + } |
| 99 | + } else { |
| 100 | + if (!class_exists(TraceableCacheAdapter::class, false)) { |
| 101 | + class_alias(TraceableCacheAdapterForV2::class, TraceableCacheAdapter::class); |
| 102 | + } |
| 103 | + |
| 104 | + if (!class_exists(TraceableTagAwareCacheAdapter::class, false)) { |
| 105 | + class_alias(TraceableTagAwareCacheAdapterForV2::class, TraceableTagAwareCacheAdapter::class); |
| 106 | + } |
| 107 | + } |
| 108 | +} |
| 109 | + |
82 | 110 | if (!interface_exists(DoctrineMiddlewareInterface::class)) {
|
83 | 111 | class_alias(MiddlewareInterface::class, DoctrineMiddlewareInterface::class);
|
84 | 112 | }
|
|
0 commit comments