Skip to content

[WebProfilerBundle] Add link to show profile of latest request #14264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

xelaris
Copy link
Contributor

@xelaris xelaris commented Apr 7, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

This PR adds a "View latest" link next to "View last 10" to enable quick access to the profile of the latest request. This is useful especially when using the profiler along with a REST client. After sending a new request it is now possible to view the latest profile with just one click.

@aitboudad
Copy link
Contributor

@xelaris xelaris force-pushed the profiler-latest-request branch from 40d45eb to 8a8b211 Compare April 8, 2015 18:18
@xelaris
Copy link
Contributor Author

xelaris commented Apr 8, 2015

Thanks for the review. The PR is updated to show a more precise message, if there are no profiles.

if ('latest' === $token) {
$latest = current($this->profiler->find(null, null, 1, null, null, null));
$token = $latest ? $latest['token'] : $token;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would simplify the code to:

        if ('latest' === $token && $latest = current($this->profiler->find(null, null, 1, null, null, null))) {
            $token = $latest['token'];
        }

@xelaris xelaris force-pushed the profiler-latest-request branch from 8a8b211 to 85f1c1c Compare May 16, 2015 16:59
@xelaris
Copy link
Contributor Author

xelaris commented May 16, 2015

@fabpot I changed the code as suggested.

@xelaris
Copy link
Contributor Author

xelaris commented Jul 15, 2015

I think this can be merged in 2.8 as it is, can't it?

@fabpot
Copy link
Member

fabpot commented Jul 15, 2015

Thank you @xelaris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants