Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
8f24d832
Commit
8f24d832
authored
Apr 04, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing profiler.
parent
17bd505f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
profiler.php
laravel/profiling/profiler.php
+19
-2
No files found.
laravel/profiling/profiler.php
View file @
8f24d832
...
...
@@ -18,10 +18,14 @@ class Profiler {
/**
* Get the rendered contents of the Profiler.
*
* @param Response $response
* @return string
*/
public
static
function
render
()
public
static
function
render
(
$response
)
{
// We only want to send the profiler toolbar if the request is not an AJAX
// request, as sending it on AJAX requests could mess up JSON driven API
// type applications, so we will not send anything in those scenarios.
if
(
!
Request
::
ajax
())
{
return
render
(
'path: '
.
__DIR__
.
'/template'
.
BLADE_EXT
,
static
::
$data
);
...
...
@@ -56,6 +60,19 @@ class Profiler {
static
::
$data
[
'queries'
][]
=
array
(
$sql
,
$time
);
}
/**
* Determine if the given response includes jQuery.
*
* @param Response $response
* @return bool
*/
protected
static
function
has_jquery
(
$response
)
{
$pattern
=
'/\<head>(.*)\<script(.+)jquery(.*)\>\<\/script\>(.*)\<\/head\>/'
;
return
preg_match
(
$pattern
,
$response
->
content
);
}
/**
* Attach the Profiler's event listeners.
*
...
...
@@ -81,7 +98,7 @@ class Profiler {
// browser. This will display the profiler's nice toolbar.
Event
::
listen
(
'laravel.done'
,
function
(
$response
)
{
echo
Profiler
::
render
();
echo
Profiler
::
render
(
$response
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment