php-debugbar
php-debugbar copied to clipboard
Support doctrine 3.x
- Closes #768
- Closes #774
https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/configuration.html
The code was moved from \DebugBar\Bridge\DoctrineCollector to \DebugBar\Bridge\Doctrine\DoctrineCollector and the middleware was added, it keeps 2.x support on \DebugBar\Bridge\DoctrineCollector
the middleware wraps doctrine connection, is there a better way to achieve this?
UPDATE1: it seems that doctrine 3.x does not support php 8.0
UPDATE2: durationBackground added, events like transaction are now better differentiated, events are avoided from being counted as statements
Would it make more sense to create php-debugbar/doctrine-bridge or something?
It's a bit difficult to pin dependencies and things like that. And making changes or upgrading in the future with breaking changes, make it also difficult.
Would it make more sense to create php-debugbar/doctrine-bridge or something?
Maybe, but since there was already support for 2x I thought about adding it here. In that case, shouldn't all the bridges be separated? Monolog for example
It's a bit difficult to pin dependencies and things like that. And making changes or upgrading in the future with breaking changes, make it also difficult.
Is it because of the integration test? Yes, it's difficult.
well yeah it's mostly difficult because we don't actually add the depencies so we cannot bump anything.
In my opinion, the only thing that saves this type of thing is that it is not a production package, you can adapt it to your local environment in your own way.
merge?.. New way is not worse performance-wise right?
New way is not worse performance-wise right?
That shouldn't be the case, but try it and tell us, I don't use Doctrine, I'm just trying to help
I think I'm gonna make a seperate repo. Just thinking about how to do it cleanly. Shall I make the base package and let @erikn69 PR his code (copy paste) it?
Sorry for the delay, but I have create the repo here: https://github.com/php-debugbar/doctrine-bridge
I added the existing bridge, under 1 namespace deeper to avoid conflicts (so DebugBar\Bridge\Doctrine\DoctrineCollector instead of DebugBar\Bridge\DoctrineCollector
The tests seem to be passing, so if you want you can apply this PR there. Or I can copy it over if you prefer.
We can the deprecate the bridge in this package, and remove it in 3.x. Perhaps we can do the same for Twig and perhaps others.
Ok, I'll take a look at it.