Skip to content

Commit 8656ec8

Browse files
committed
fix: compatibility with old mongodb prime
1 parent ca653af commit 8656ec8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Collector/PrimeDataCollector.php

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Bdf\PrimeBundle\Collector;
44

55
use Bdf\Prime\Connection\Middleware\LoggerMiddleware;
6+
use Bdf\Prime\MongoDB\Collection\MongoCollectionLocator;
7+
use Bdf\Prime\MongoDB\Driver\MongoConnectionFactory;
68
use Doctrine\Bundle\DoctrineBundle\DataCollector\DoctrineDataCollector;
79
use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
810
use Doctrine\Persistence\ManagerRegistry;
@@ -23,6 +25,7 @@ public function __construct(ManagerRegistry $registry, bool $shouldValidateSchem
2325
&& \class_exists(DebugDataHolder::class)
2426
&& \interface_exists(MiddlewareInterface::class)
2527
&& \class_exists(LoggerMiddleware::class)
28+
&& (!\class_exists(MongoCollectionLocator::class) || \class_exists(MongoConnectionFactory::class))
2629
) {
2730
$debugDataHolder = new DebugDataHolder();
2831
}

0 commit comments

Comments
 (0)