From 4a2eab6e78fc384313cda9b4783a0ddc7a5d7cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Guti=C3=A9rrez?= Date: Wed, 19 Sep 2018 14:59:07 +0200 Subject: [PATCH] ORM Installation check (#115) * do not assume ORM existence for token class and object manager --- DependencyInjection/GesdinetJWTRefreshTokenExtension.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/GesdinetJWTRefreshTokenExtension.php b/DependencyInjection/GesdinetJWTRefreshTokenExtension.php index c2479c61..3ec499fa 100644 --- a/DependencyInjection/GesdinetJWTRefreshTokenExtension.php +++ b/DependencyInjection/GesdinetJWTRefreshTokenExtension.php @@ -43,7 +43,9 @@ public function load(array $configs, ContainerBuilder $container) $refreshTokenClass = 'Gesdinet\JWTRefreshTokenBundle\Entity\RefreshToken'; $objectManager = 'doctrine.orm.entity_manager'; - if ('mongodb' === strtolower($config['manager_type'])) { + if (!class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass') + || 'mongodb' === strtolower($config['manager_type']) + ) { $refreshTokenClass = 'Gesdinet\JWTRefreshTokenBundle\Document\RefreshToken'; $objectManager = 'doctrine_mongodb.odm.document_manager'; }