Git Product home page Git Product logo

Comments (26)

stood avatar stood commented on July 30, 2024

Yes we work on this bug : pomm-project/pomm-symfony-bridge#20

from pomm-bundle.

npanau avatar npanau commented on July 30, 2024

Ok thanks, FYI, it is on SF2.8.

from pomm-bundle.

chanmix51 avatar chanmix51 commented on July 30, 2024

Weird, I don't have the problem with Silex. @sanpii ?

from pomm-bundle.

sanpii avatar sanpii commented on July 30, 2024

I made a rapid composer update on my symbiose project and I have a log. Do you use the query manager?

screen shot 2015-12-22 at 23 54 17

from pomm-bundle.

npanau avatar npanau commented on July 30, 2024

Not yet ; I'm on describing CRUD operations, I only use default queries for now (eg findAll(), findByPK(), createAndSave()...)

from pomm-bundle.

chanmix51 avatar chanmix51 commented on July 30, 2024

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.

npanau avatar npanau commented on July 30, 2024

Sure :

    /**
     * Edition ...
     */
    public function editAction($id, Request $request)
    {
        $user = $this
            ->container->get('pomm')['my_db']
            ->getModel(UserModel::class)
            ->findByPK([
                'id' => $id
            ]);
    //...

capture d ecran 2015-12-23 a 10 46 13
(is that what you meant for the shot?)

from pomm-bundle.

chanmix51 avatar chanmix51 commented on July 30, 2024

You have a findByPK in a edit url ? I ask to understand if you have been redirected or not.

from pomm-bundle.

npanau avatar npanau commented on July 30, 2024

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.

chanmix51 avatar chanmix51 commented on July 30, 2024

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.

npanau avatar npanau commented on July 30, 2024

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.

SebLours avatar SebLours commented on July 30, 2024

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.

stood avatar stood commented on July 30, 2024

#48

from pomm-bundle.

Nedeas avatar Nedeas commented on July 30, 2024

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.

chanmix51 avatar chanmix51 commented on July 30, 2024

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.

stood avatar stood commented on July 30, 2024

Because UserProvider with loadUserByUsername will use Pomm before the listener DatabaseDataCollector that start

from pomm-bundle.

Nedeas avatar Nedeas commented on July 30, 2024

@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.

stood avatar stood commented on July 30, 2024

@Nedeas yes I have the same pb because pomm is started with UserProvider and Listener for dataCollector after.

from pomm-bundle.

chanmix51 avatar chanmix51 commented on July 30, 2024

How can we fix that ?

from pomm-bundle.

sanpii avatar sanpii commented on July 30, 2024

symfony/symfony#17612

from pomm-bundle.

stof avatar stof commented on July 30, 2024

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.

chanmix51 avatar chanmix51 commented on July 30, 2024

@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.

npanau avatar npanau commented on July 30, 2024

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.

stof avatar stof commented on July 30, 2024

@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.

stood avatar stood commented on July 30, 2024

@npanau plz close if it's ok

from pomm-bundle.

rdavaillaud avatar rdavaillaud commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.