Comments (26)
Yes we work on this bug : pomm-project/pomm-symfony-bridge#20
from pomm-bundle.
Ok thanks, FYI, it is on SF2.8.
from pomm-bundle.
Weird, I don't have the problem with Silex. @sanpii ?
from pomm-bundle.
I made a rapid composer update
on my symbiose project and I have a log. Do you use the query manager?
from pomm-bundle.
Not yet ; I'm on describing CRUD operations, I only use default queries for now (eg findAll(), findByPK(), createAndSave()...)
from pomm-bundle.
These queries should show up in the profiler. Can you show us a controller where those queries are used with a shot of the profiler of the same URL ?
from pomm-bundle.
Sure :
/**
* Edition ...
*/
public function editAction($id, Request $request)
{
$user = $this
->container->get('pomm')['my_db']
->getModel(UserModel::class)
->findByPK([
'id' => $id
]);
//...
(is that what you meant for the shot?)
from pomm-bundle.
You have a findByPK in a edit url ? I ask to understand if you have been redirected or not.
from pomm-bundle.
Yep ; I have not been redirected, 0 is the PK of this entry. Btw, the query does return me the correct results, and the Flexible entity is hydrated.
from pomm-bundle.
I can't reproduce the bug. I installed a fresh version of sf 2.8 using symfony’s installer, setup as indicated on pomm-bundle’s README and I could see the queries in the profiler.
from pomm-bundle.
ok ; mine is an updated version, not a fresh install ; this is probably due to my setup. I'll try to reinstall everything and dig in this issue.
from pomm-bundle.
Hi all,
For me on a fresh install of Symfony 3.0.0, i don't have any data into the pomm profiler.
I can get some pomm data collecting like this:
$session = $this->get('pomm.default_session');
$dataCollector = $this->get('pomm.data_collector');
$session
->getClientUsingPooler('listener', 'query')
->attachAction([$dataCollector, 'execute'])
;
$crews = $session
->getQueryManager()
->query($sql)
;
After some code inspection, i think that the data collector service is created after the Pomm session creation. The session builder post configuration is never called.
from pomm-bundle.
from pomm-bundle.
Hi,
I work with npanau and I search the origin of this bug.
In symfony 2.8.2, when I add custom UserProvider (used Pomm) in security, the Pomm profiler doesn't work.
If I remove then, Pomm profiler works.
When Pomm profiler doesn't work, I have this in log :
17:56:23
app Pomm: ListenerPooler: notification received.
Context: { "receivers": "query:pre" }
17:56:23
app Pomm: ListenerPooler: notification received.
Context: { "receivers": "query:post" }
from pomm-bundle.
These are the notifications emitted by Pomm before and after a query is sent. You should also have these lines when the profiler works.
from pomm-bundle.
Because UserProvider with loadUserByUsername will use Pomm before the listener DatabaseDataCollector that start
from pomm-bundle.
@chanmix5 : Yes but I have always 0 query in debug bar.
@stood : I have a query in controller for test and I have 0 query in debug bar.
from pomm-bundle.
@Nedeas yes I have the same pb because pomm is started with UserProvider and Listener for dataCollector after.
from pomm-bundle.
How can we fix that ?
from pomm-bundle.
from pomm-bundle.
IMO, the issue is that the instantiation of the profiler collector is the place where PommBundle is registering the profiler in the connection. This expects the profiler collector to be instantiated before any request is made with Pomm. But there is no such guarantee in Symfony (services are instantiated the first time they are needed in some object graph, so there is exactly no guarantee about when this happens). Registering the profiling in the connection should be done in the instantiation of the connection service, so that it is done as soon as the connection is needed to ensure it is done.
from pomm-bundle.
@stof sorry to ask but I do not understand what you mean by «Registering the profiling in the connection». What connection are you mentioning here ?
from pomm-bundle.
Hi there,
Good news : since my last composer update, the profiler is showing :)
Here's the references :
- Updating pomm-project/pomm-symfony-bridge dev-master (691df46 => f168161)
Checking out f168161ea1c5ba5e12e137a58f814b1769147f70
- Updating pomm-project/pomm-bundle dev-master (d967d19 => 7e60325)
Checking out 7e60325d3a85068c223f5def5d87f7984b8d93d9
- Updating pomm-project/foundation 2.0.x-dev (6435ae2 => 1438035)
Checking out 1438035a643b1bd6fdd572ec22951adb6e382b54
Good job!
from pomm-bundle.
@chanmix51 replace "connection" by "session" to use the Pomm namings. But this was solved by pomm-project/pomm-symfony-bridge#24 and #50
from pomm-bundle.
@npanau plz close if it's ok
from pomm-bundle.
I still have the same bug with latest stable version of pomm bundles and Symfony 3.1.5).
I also have a custom UserProvider using pomm, and no quey in the profiler.
I am using theodo-evolution/session-bundle to share user cookie with sf1 and load the user from the cookie's user id.
Using Symfony Guard as authentication mecanism.
<?php
...
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class CookieLoginAuthenticator extends AbstractGuardAuthenticator
{
private $router;
private $pomm;
public function __construct(\PommProject\Foundation\Pomm $pomm, RouterInterface $router)
{
$this->router = $router;
$this->pomm = $pomm;
}
public function getCredentials(Request $request)
{
$guardUser = $request->getSession()->getBag('symfony/user/sfUser/attributes')->get('sfGuardSecurityUser');
return $guardUser;
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
$userId = $credentials['user_id'];
$user = $this->pomm['lpdipro']
->getModel('\AppBundle\Security\User\LPdIUserModel')
->findByPK(['id' => (int)$userId]);
if (is_null($user)) {
throw new UsernameNotFoundException(
sprintf('User id "%s" does not exist.', $userId)
);
}
return $user;
}
...
When no user is authentified (profiler showing anon.), I've got the correct query count, when the user is authentified, no query.
from pomm-bundle.
Related Issues (20)
- Question about Injection via symfony instead of Pooler HOT 6
- [Profiler] Add the "See runnable query"
- [ProfilerExtension] Twig Extensions is abandonned
- The PommProject\SymfonyBridge\PropertyInfo\Extractor\PommExtractor class is deprecated HOT 6
- Pomm Bundle not compatible with PHP >= 8.x
- Unique "Object" Validator in Pomm HOT 1
- Still not stable? HOT 10
- Twig and relation HOT 2
- Unable to load @ParamConverter annotation HOT 1
- impossible to use a session builder as a service HOT 8
- impossible to initialize a modelLayer
- deprecated configuration key throws an exception with Sf 3.3 HOT 1
- Warning raised with SF 3.3 in ContainerModelLayerPooler HOT 2
- BC break: default session builder should be the model manager HOT 1
- Support symfony4 HOT 2
- Rewrite test for sf4 HOT 1
- Update README with flex installation instruction HOT 1
- An alias can not reference itself, got a circular reference on ProductModel HOT 3
- Error 500 on query explain HOT 1
- Custom converter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pomm-bundle.