liip / LiipMonitorBundle

Integrates the LiipMonitor library into Symfony
http://liip.ch
467 stars 103 forks source link

Check for doctrine does not work with doctrine/dbal v3 #256

Closed notFloran closed 3 years ago

notFloran commented 3 years ago

We are trying to use the bundle with doctrine/dbal v3 and it does not work for the following reasons:

Error: Call to undefined method Doctrine\DBAL\Connection::fetchColumn()
/builds/wizifarm/wizifarm/vendor/liip/monitor-bundle/Check/DoctrineDbal.php:24

According to https://www.doctrine-project.org/2020/11/17/dbal-3.0.0.html the method has been removed and we must use fetchOne.

I am ready to do a PR but I don't know how to properly handle dbal 2 and 3 at the same time : I was thinking of using Doctrine\DBAL\Version but the class is marked as internal and deprecated.

kbond commented 3 years ago

What about method_exists($connection, 'fetchOne')?