Laravel version update
Laravel version update
This commit is contained in:
@@ -68,7 +68,7 @@ class TwigCollector extends DataCollector implements Renderable, AssetProvider
|
||||
'icon' => 'leaf',
|
||||
'widget' => 'PhpDebugBar.Widgets.TemplatesWidget',
|
||||
'map' => 'twig',
|
||||
'default' => '[]'
|
||||
'default' => json_encode(array('templates' => array())),
|
||||
),
|
||||
'twig:badge' => array(
|
||||
'map' => 'twig.nb_templates',
|
||||
|
@@ -98,7 +98,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
|
||||
);
|
||||
|
||||
foreach ($this->connections as $name => $pdo) {
|
||||
$pdodata = $this->collectPDO($pdo, $this->timeCollector);
|
||||
$pdodata = $this->collectPDO($pdo, $this->timeCollector, $name);
|
||||
$data['nb_statements'] += $pdodata['nb_statements'];
|
||||
$data['nb_failed_statements'] += $pdodata['nb_failed_statements'];
|
||||
$data['accumulated_duration'] += $pdodata['accumulated_duration'];
|
||||
@@ -120,10 +120,16 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
|
||||
*
|
||||
* @param TraceablePDO $pdo
|
||||
* @param TimeDataCollector $timeCollector
|
||||
* @param string|null $connectionName the pdo connection (eg default | read | write)
|
||||
* @return array
|
||||
*/
|
||||
protected function collectPDO(TraceablePDO $pdo, TimeDataCollector $timeCollector = null)
|
||||
protected function collectPDO(TraceablePDO $pdo, TimeDataCollector $timeCollector = null, $connectionName = null)
|
||||
{
|
||||
if (empty($connectionName) || $connectionName == 'default') {
|
||||
$connectionName = 'pdo';
|
||||
} else {
|
||||
$connectionName = 'pdo ' . $connectionName;
|
||||
}
|
||||
$stmts = array();
|
||||
foreach ($pdo->getExecutedStatements() as $stmt) {
|
||||
$stmts[] = array(
|
||||
@@ -143,7 +149,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
|
||||
'error_message' => $stmt->getErrorMessage()
|
||||
);
|
||||
if ($timeCollector !== null) {
|
||||
$timeCollector->addMeasure($stmt->getSql(), $stmt->getStartTime(), $stmt->getEndTime());
|
||||
$timeCollector->addMeasure($stmt->getSql(), $stmt->getStartTime(), $stmt->getEndTime(), array(), $connectionName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +181,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
|
||||
{
|
||||
return array(
|
||||
"database" => array(
|
||||
"icon" => "inbox",
|
||||
"icon" => "database",
|
||||
"widget" => "PhpDebugBar.Widgets.SQLQueriesWidget",
|
||||
"map" => "pdo",
|
||||
"default" => "[]"
|
||||
|
@@ -198,6 +198,13 @@ class TimeDataCollector extends DataCollector implements Renderable
|
||||
$this->stopMeasure($name);
|
||||
}
|
||||
|
||||
usort($this->measures, function($a, $b) {
|
||||
if ($a['start'] == $b['start']) {
|
||||
return 0;
|
||||
}
|
||||
return $a['start'] < $b['start'] ? -1 : 1;
|
||||
});
|
||||
|
||||
return array(
|
||||
'start' => $this->requestStartTime,
|
||||
'end' => $this->requestEndTime,
|
||||
|
@@ -19,6 +19,7 @@ div.phpdebugbar {
|
||||
text-align: left;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
div.phpdebugbar a,
|
||||
|
@@ -396,7 +396,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
|
||||
options: {
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom'))
|
||||
bodyMarginBottomHeight: 0
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
@@ -406,6 +406,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
this.firstTabName = null;
|
||||
this.activePanelName = null;
|
||||
this.datesetTitleFormater = new DatasetTitleFormater(this);
|
||||
this.options.bodyMarginBottomHeight = parseInt($('body').css('margin-bottom'));
|
||||
this.registerResizeHandler();
|
||||
},
|
||||
|
||||
@@ -831,7 +832,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
return $('body').css('margin-bottom', this.options.bodyMarginBottomHeight || '');
|
||||
}
|
||||
|
||||
var offset = parseInt(this.$el.height()) + this.options.bodyMarginBottomHeight;
|
||||
var offset = parseInt(this.$el.height()) + (this.options.bodyMarginBottomHeight || 0);
|
||||
$('body').css('margin-bottom', offset);
|
||||
}
|
||||
},
|
||||
@@ -1019,6 +1020,10 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
* @return {Bool}
|
||||
*/
|
||||
handle: function(xhr) {
|
||||
// Check if the debugbar header is available
|
||||
if (xhr.getAllResponseHeaders().indexOf(this.headerName) === -1){
|
||||
return true;
|
||||
}
|
||||
if (!this.loadFromId(xhr)) {
|
||||
return this.loadFromData(xhr);
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@
|
||||
for (var key in stmt.params) {
|
||||
if (typeof stmt.params[key] !== 'function') {
|
||||
table.append('<tr><td class="' + csscls('name') + '">' + key + '</td><td class="' + csscls('value') +
|
||||
'">' + stmt.params[key] + '</td></tr>');
|
||||
'">' + stmt.params[key] + '</td></tr>');
|
||||
}
|
||||
}
|
||||
li.css('cursor', 'pointer').click(function() {
|
||||
@@ -91,7 +91,7 @@
|
||||
this.$status.empty();
|
||||
|
||||
// Search for duplicate statements.
|
||||
for (var sql = {}, duplicate = 0, i = 0; i < data.statements.length; i++) {
|
||||
for (var sql = {}, unique = 0, i = 0; i < data.statements.length; i++) {
|
||||
var stmt = data.statements[i].sql;
|
||||
if (data.statements[i].params && !$.isEmptyObject(data.statements[i].params)) {
|
||||
stmt += ' {' + $.param(data.statements[i].params, false) + '}';
|
||||
@@ -102,10 +102,10 @@
|
||||
// Add classes to all duplicate SQL statements.
|
||||
for (var stmt in sql) {
|
||||
if (sql[stmt].keys.length > 1) {
|
||||
duplicate++;
|
||||
unique++;
|
||||
for (var i = 0; i < sql[stmt].keys.length; i++) {
|
||||
this.$list.$el.find('.' + csscls('list-item')).eq(sql[stmt].keys[i])
|
||||
.addClass(csscls('sql-duplicate')).addClass(csscls('sql-duplicate-'+duplicate));
|
||||
.addClass(csscls('sql-duplicate')).addClass(csscls('sql-duplicate-'+unique));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,8 +114,9 @@
|
||||
if (data.nb_failed_statements) {
|
||||
t.append(", " + data.nb_failed_statements + " of which failed");
|
||||
}
|
||||
if (duplicate) {
|
||||
t.append(", " + duplicate + " of which were duplicated");
|
||||
if (unique) {
|
||||
t.append(", " + (data.nb_statements - unique) + " of which were duplicated");
|
||||
t.append(", " + unique + " unique");
|
||||
}
|
||||
if (data.accumulated_duration_str) {
|
||||
this.$status.append($('<span title="Accumulated duration" />').addClass(csscls('duration')).text(data.accumulated_duration_str));
|
||||
|
Reference in New Issue
Block a user