first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,14 @@
/**
* @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* Debug Bar */
.phpdebugbar-badge {
color: #fff !important;
background-color: rgb(40,70,106) !important;
}
div.phpdebugbar-header, a.phpdebugbar-restore-btn {
background: #efefef url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 149.7 149.6' width='30px' height='30px'><path fill='rgb(40,70,106)' d='M141.4 42v.5H140V46h-.5v-3.5h-1.3V42h3.2z'/><path fill='rgb(40,70,106)' d='M141.8 42h.8l1.1 3.3 1.1-3.3h.8v3.9h-.5v-2.3-.4-.6l-1.1 3.3h-.5l-1.1-3.3V45.8h-.5V42z'/><g><path d='M27 75.5l-2.9-2.9c-8.9-8.9-11.7-21.7-8.3-33C6.9 37.6.2 29.6.2 20.1c0-11.1 9-20 20-20 10 0 18.2 7.3 19.8 16.8 10.8-2.5 22.6.4 31.1 8.8l1.2 1.2-14.9 14.7-1.1-1.2c-4.8-4.8-12.6-4.8-17.4 0-4.8 4.8-4.8 12.6 0 17.4l2.9 2.9 14.8 14.8 15.6 15.6-14.8 14.8-15.6-15.7L27 75.5z' fill='rgb(40,70,106)'/><path d='M43.5 58.9l15.6-15.6 14.8-14.8 2.9-2.9c8.9-8.9 21.6-11.7 32.8-8.4C111 7.5 119.4 0 129.5 0c11.1 0 20 9 20 20 0 10.2-7.6 18.6-17.4 19.9 3.2 11.2.4 23.8-8.4 32.7l-1.2 1.2L107.7 59l1.1-1.1c4.8-4.8 4.8-12.6 0-17.4-4.8-4.8-12.5-4.8-17.4 0l-2.9 2.9-14.6 14.7-15.6 15.6-14.8-14.8z' fill='rgb(40,70,106)'/><path d='M110.1 133.5c-11.4 3.5-24.2.7-33.2-8.3l-1.1-1.1 14.8-14.8 1.1 1.1c4.8 4.8 12.6 4.8 17.4 0 4.8-4.8 4.8-12.5 0-17.4l-2.9-2.9-14.9-14.6-15.6-15.7L90.5 45l15.6 15.6 14.8 14.8 2.9 2.9c8.5 8.5 11.4 20.5 8.8 31.3 9.7 1.4 17.2 9.7 17.2 19.8 0 11.1-9 20-20 20-9.8.2-17.9-6.7-19.7-15.9z' fill='rgb(40,70,106)'/><path d='M104.3 92l-15.6 15.6-14.8 14.8-2.9 2.9c-8.5 8.5-20.6 11.4-31.5 8.7-2 8.9-10 15.5-19.5 15.5-11.1 0-20-9-20-20 0-9.5 6.6-17.4 15.4-19.5-2.8-11 .1-23.1 8.7-31.7l1.1-1.1L40 92l-1.1 1.1c-4.8 4.8-4.8 12.6 0 17.4 4.8 4.8 12.6 4.8 17.4 0l2.9-2.9L74 92.8l15.6-15.6L104.3 92z' fill='rgb(40,70,106)'/></g></svg>") no-repeat 5px 4px / 20px 20px !important;
}

View File

@ -0,0 +1 @@
.phpdebugbar-badge{background-color:#28466a!important;color:#fff!important}a.phpdebugbar-restore-btn,div.phpdebugbar-header{background:#efefef url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 149.7 149.6' width='30px' height='30px'><path fill='rgb(40,70,106)' d='M141.4 42v.5H140V46h-.5v-3.5h-1.3V42h3.2z'/><path fill='rgb(40,70,106)' d='M141.8 42h.8l1.1 3.3 1.1-3.3h.8v3.9h-.5v-2.3-.4-.6l-1.1 3.3h-.5l-1.1-3.3V45.8h-.5V42z'/><g><path d='M27 75.5l-2.9-2.9c-8.9-8.9-11.7-21.7-8.3-33C6.9 37.6.2 29.6.2 20.1c0-11.1 9-20 20-20 10 0 18.2 7.3 19.8 16.8 10.8-2.5 22.6.4 31.1 8.8l1.2 1.2-14.9 14.7-1.1-1.2c-4.8-4.8-12.6-4.8-17.4 0-4.8 4.8-4.8 12.6 0 17.4l2.9 2.9 14.8 14.8 15.6 15.6-14.8 14.8-15.6-15.7L27 75.5z' fill='rgb(40,70,106)'/><path d='M43.5 58.9l15.6-15.6 14.8-14.8 2.9-2.9c8.9-8.9 21.6-11.7 32.8-8.4C111 7.5 119.4 0 129.5 0c11.1 0 20 9 20 20 0 10.2-7.6 18.6-17.4 19.9 3.2 11.2.4 23.8-8.4 32.7l-1.2 1.2L107.7 59l1.1-1.1c4.8-4.8 4.8-12.6 0-17.4-4.8-4.8-12.5-4.8-17.4 0l-2.9 2.9-14.6 14.7-15.6 15.6-14.8-14.8z' fill='rgb(40,70,106)'/><path d='M110.1 133.5c-11.4 3.5-24.2.7-33.2-8.3l-1.1-1.1 14.8-14.8 1.1 1.1c4.8 4.8 12.6 4.8 17.4 0 4.8-4.8 4.8-12.5 0-17.4l-2.9-2.9-14.9-14.6-15.6-15.7L90.5 45l15.6 15.6 14.8 14.8 2.9 2.9c8.5 8.5 11.4 20.5 8.8 31.3 9.7 1.4 17.2 9.7 17.2 19.8 0 11.1-9 20-20 20-9.8.2-17.9-6.7-19.7-15.9z' fill='rgb(40,70,106)'/><path d='M104.3 92l-15.6 15.6-14.8 14.8-2.9 2.9c-8.5 8.5-20.6 11.4-31.5 8.7-2 8.9-10 15.5-19.5 15.5-11.1 0-20-9-20-20 0-9.5 6.6-17.4 15.4-19.5-2.8-11 .1-23.1 8.7-31.7l1.1-1.1L40 92l-1.1 1.1c-4.8 4.8-4.8 12.6 0 17.4 4.8 4.8 12.6 4.8 17.4 0l2.9-2.9L74 92.8l15.6-15.6L104.3 92z' fill='rgb(40,70,106)'/></g></svg>") no-repeat 5px 4px /20px 20px!important}

Binary file not shown.

View File

@ -0,0 +1,35 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(document => {
// Selectors used by this script
const debugSectionTogglerSelector = '.dbg-header';
const toggleTargetAttribute = 'data-debug-toggle';
/**
* Toggle an element by id
* @param id
*/
const toggle = id => {
document.getElementById(id).classList.toggle('hidden');
};
/**
* Register events
*/
const registerEvents = () => {
const sectionTogglers = [].slice.call(document.querySelectorAll(debugSectionTogglerSelector));
sectionTogglers.forEach(toggler => {
toggler.addEventListener('click', event => {
event.preventDefault();
toggle(toggler.getAttribute(toggleTargetAttribute));
});
});
};
document.addEventListener('DOMContentLoaded', () => {
registerEvents();
});
})(document);

View File

@ -0,0 +1 @@
(e=>{const t=()=>{[].slice.call(e.querySelectorAll(".dbg-header")).forEach((t=>{t.addEventListener("click",(d=>{var l;d.preventDefault(),l=t.getAttribute("data-debug-toggle"),e.getElementById(l).classList.toggle("hidden")}))}))};e.addEventListener("DOMContentLoaded",(()=>{t()}))})(document);

Binary file not shown.

View File

@ -0,0 +1,32 @@
table.phpdebugbar-widgets-info {
width: 75%;
margin-top: 5px;
margin-left: 5px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 1.3em;
}
table.phpdebugbar-widgets-info td {
padding-right: 10px;
border-bottom: 1px solid #c0c0c0;
}
table.phpdebugbar-widgets-info dt {
float: left;
width: 30%;
padding: .25em;
clear: left;
text-align: left;
}
table.phpdebugbar-widgets-info dd {
float: left;
width: 60%;
padding: .25em 0;
}
table.phpdebugbar-widgets-info dl:after {
display: table;
clear: both;
content: "";
}

View File

@ -0,0 +1,67 @@
(function ($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-')
var InfoWidget = PhpDebugBar.Widgets.InfoWidget = PhpDebugBar.Widget.extend({
tagName: 'table',
className: csscls('info'),
render: function () {
this.bindAttr('data', function (data) {
this.$el.empty()
var tr
/*
// @todo enable Info link
var link = $('<a />')
.text('Info')
.attr('href', 'index.php?option=com_content&view=debug&id=' + data.requestId)
.attr('target', '_blank');
tr = $('<tr />')
.append($('<td />').text('Info'))
.append($('<td />').append(link));
this.$el.append(tr);
*/
tr = $('<tr />')
.append($('<td />').text('Joomla! Version'))
.append($('<td />').text(data.joomlaVersion))
this.$el.append(tr)
tr = $('<tr />')
.append($('<td />').text('PHP Version'))
.append($('<td />').text(data.phpVersion))
this.$el.append(tr)
tr = $('<tr />')
.append($('<td />').text('Identity'))
.append($('<td />').text(data.identity.type))
this.$el.append(tr)
tr = $('<tr />')
.append($('<td />').text('Response'))
.append($('<td />').text(data.response.status_code))
this.$el.append(tr)
tr = $('<tr />')
.append($('<td />').text('Template'))
.append($('<td />').text(data.template.template))
this.$el.append(tr)
tr = $('<tr />')
.append($('<td />').text('Database'))
.append($('<td />').html(
'<dl>'
+ '<dt>Server</dt><dd>' + data.database.dbserver + '</dd>'
+ '<dt>Version</dt><dd>' + data.database.dbversion + '</dd>'
+ '<dt>Collation</dt><dd>' + data.database.dbcollation + '</dd>'
+ '<dt>Conn Collation</dt><dd>' + data.database.dbconnectioncollation + '</dd>'
+ '</dl>'
))
this.$el.append(tr)
})
}
})
})(PhpDebugBar.$)

View File

@ -0,0 +1 @@
table.phpdebugbar-widgets-info{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:1.3em;margin-left:5px;margin-top:5px;width:75%}table.phpdebugbar-widgets-info td{border-bottom:1px solid silver;padding-right:10px}table.phpdebugbar-widgets-info dt{clear:left;float:left;padding:.25em;text-align:left;width:30%}table.phpdebugbar-widgets-info dd{float:left;padding:.25em 0;width:60%}table.phpdebugbar-widgets-info dl:after{clear:both;content:"";display:table}

Binary file not shown.

View File

@ -0,0 +1 @@
!function(t){var e=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.InfoWidget=PhpDebugBar.Widget.extend({tagName:"table",className:e("info"),render:function(){this.bindAttr("data",(function(e){var d;this.$el.empty(),d=t("<tr />").append(t("<td />").text("Joomla! Version")).append(t("<td />").text(e.joomlaVersion)),this.$el.append(d),d=t("<tr />").append(t("<td />").text("PHP Version")).append(t("<td />").text(e.phpVersion)),this.$el.append(d),d=t("<tr />").append(t("<td />").text("Identity")).append(t("<td />").text(e.identity.type)),this.$el.append(d),d=t("<tr />").append(t("<td />").text("Response")).append(t("<td />").text(e.response.status_code)),this.$el.append(d),d=t("<tr />").append(t("<td />").text("Template")).append(t("<td />").text(e.template.template)),this.$el.append(d),d=t("<tr />").append(t("<td />").text("Database")).append(t("<td />").html("<dl><dt>Server</dt><dd>"+e.database.dbserver+"</dd><dt>Version</dt><dd>"+e.database.dbversion+"</dd><dt>Collation</dt><dd>"+e.database.dbcollation+"</dd><dt>Conn Collation</dt><dd>"+e.database.dbconnectioncollation+"</dd></dl>")),this.$el.append(d)}))}})}(PhpDebugBar.$);

Binary file not shown.

View File

@ -0,0 +1,6 @@
ul.phpdebugbar-widgets-languageErrors {
margin-top: 5px;
margin-left: 5px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 1.3em;
}

View File

@ -0,0 +1,35 @@
(function ($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-')
var languageErrorsWidget = PhpDebugBar.Widgets.languageErrorsWidget = PhpDebugBar.Widget.extend({
tagName: 'ul',
className: csscls('languageErrors'),
render: function () {
this.bindAttr('data', function (data) {
this.$el.empty()
for (var file of data.files) {
var relPath = file[0].replace(data.jroot, '')
var li = $('<li />')
if (data.xdebugLink) {
var link = $('<a />')
.text(relPath + ':' + file[1])
.attr(
'href',
data.xdebugLink
.replace('%f', file[0])
.replace('%l', file[1])
)
li.append(link)
} else {
li.text(relPath + ':' + file[1])
}
this.$el.append(li)
}
})
}
})
})(PhpDebugBar.$)

View File

@ -0,0 +1 @@
ul.phpdebugbar-widgets-languageErrors{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:1.3em;margin-left:5px;margin-top:5px}

View File

@ -0,0 +1 @@
!function(e){var a=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.languageErrorsWidget=PhpDebugBar.Widget.extend({tagName:"ul",className:a("languageErrors"),render:function(){this.bindAttr("data",(function(a){for(var r of(this.$el.empty(),a.files)){var t=r[0].replace(a.jroot,""),i=e("<li />");if(a.xdebugLink){var g=e("<a />").text(t+":"+r[1]).attr("href",a.xdebugLink.replace("%f",r[0]).replace("%l",r[1]));i.append(g)}else i.text(t+":"+r[1]);this.$el.append(i)}}))}})}(PhpDebugBar.$);

View File

@ -0,0 +1,22 @@
table.phpdebugbar-widgets-languageFiles {
margin-top: 5px;
margin-left: 5px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 1.3em;
}
table.phpdebugbar-widgets-languageFiles tr {
border-bottom: 1px solid #c0c0c0;
}
table.phpdebugbar-widgets-languageFiles th {
padding: 5px;
font-weight: bold;
}
.phpdebugbar-widgets-languageFiles .alert-success,
.phpdebugbar-widgets-languageFiles .alert-warning {
color: var(--alert-color);
background-color: var(--alert-bg);
border-color: var(--alert-border-color);
}

View File

@ -0,0 +1,49 @@
(function ($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-')
var languageFilesWidget = PhpDebugBar.Widgets.languageFilesWidget = PhpDebugBar.Widget.extend({
tagName: 'table',
className: csscls('languageFiles'),
render: function () {
this.bindAttr('data', function (data) {
this.$el.empty()
var head = $('<tr />')
.append($('<th />').text('Extension'))
.append($('<th />').text('File'))
this.$el.append(head)
for (var extension in data.loaded) {
var ul = $('<ul />')
for (var file in data.loaded[extension]) {
var css = data.loaded[extension][file] ? 'alert-success' : 'alert-warning'
var status = data.loaded[extension][file] ? '+' : '-'
var relPath = status + ' ' + file.replace(data.jroot, '')
var li = $('<li />')
.addClass(css)
if (data.xdebugLink) {
var link = $('<a />')
.text(relPath)
.attr(
'href',
data.xdebugLink
.replace('%f', file)
.replace('%l', '1')
)
li.append(link)
} else {
li.text(relPath)
}
li.appendTo(ul)
}
var tr = $('<tr />')
.append($('<td />').text(extension))
.append($('<td />').append(ul))
this.$el.append(tr)
}
})
}
})
})(PhpDebugBar.$)

View File

@ -0,0 +1 @@
table.phpdebugbar-widgets-languageFiles{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:1.3em;margin-left:5px;margin-top:5px}table.phpdebugbar-widgets-languageFiles tr{border-bottom:1px solid silver}table.phpdebugbar-widgets-languageFiles th{font-weight:700;padding:5px}.phpdebugbar-widgets-languageFiles .alert-success,.phpdebugbar-widgets-languageFiles .alert-warning{background-color:var(--alert-bg);border-color:var(--alert-border-color);color:var(--alert-color)}

View File

@ -0,0 +1 @@
!function(e){var a=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.languageFilesWidget=PhpDebugBar.Widget.extend({tagName:"table",className:a("languageFiles"),render:function(){this.bindAttr("data",(function(a){this.$el.empty();var t=e("<tr />").append(e("<th />").text("Extension")).append(e("<th />").text("File"));for(var d in this.$el.append(t),a.loaded){var r=e("<ul />");for(var n in a.loaded[d]){var p=a.loaded[d][n]?"alert-success":"alert-warning",l=(a.loaded[d][n]?"+":"-")+" "+n.replace(a.jroot,""),i=e("<li />").addClass(p);if(a.xdebugLink){var s=e("<a />").text(l).attr("href",a.xdebugLink.replace("%f",n).replace("%l","1"));i.append(s)}else i.text(l);i.appendTo(r)}var g=e("<tr />").append(e("<td />").text(d)).append(e("<td />").append(r));this.$el.append(g)}}))}})}(PhpDebugBar.$);

View File

@ -0,0 +1,58 @@
table.phpdebugbar-widgets-languageStrings {
width: 100%;
margin-top: 5px;
margin-left: 5px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 1.3em;
}
table.phpdebugbar-widgets-languageStrings th {
border-bottom: 1px solid #000;
}
table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack {
display: none;
width: 100%;
margin: 10px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border-collapse: collapse;
border: 1px solid #ddd;
}
table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack tr.caller {
background-color: #fff9b6;
}
table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack tbody tr:hover {
background-color: #eee;
}
table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack th {
font-weight: bold;
}
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye,
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash {
margin-left: 8px;
color: #888;
}
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash {
color: #000;
background-color: #eee;
}
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye:before,
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash:before {
margin-right: 4px;
font-family: "Font Awesome 6 Free";
/*font-size: 12px;*/
}
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye:before {
content: "\f06e";
}
table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash:before {
content: "\f070";
}

View File

@ -0,0 +1,87 @@
(function ($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-')
var languageStringsWidget = PhpDebugBar.Widgets.languageStringsWidget = PhpDebugBar.Widget.extend({
tagName: 'table',
className: csscls('languageStrings'),
render: function () {
this.bindAttr('data', function (data) {
this.$el.empty()
for (var orphan in data.orphans) {
var tr = $('<tr />')
$('<th valign="top" style="width:10%" />').text(orphan).appendTo(tr)
var td = $('<th />').appendTo(tr)
var ul = $('<ul />').appendTo(td)
var tableStack
for (var oc in data.orphans[orphan]) {
var occurence = data.orphans[orphan][oc]
var relPath = occurence['caller'].replace(data.jroot, '')
var li = $('<li />')
if (data.xdebugLink) {
var parts = occurence['caller'].split(':')
var link = $('<a />')
.text(relPath)
.attr(
'href',
data.xdebugLink
.replace('%f', parts[0])
.replace('%l', parts[1])
)
li.append(link)
} else {
li.text(relPath)
}
if (occurence['trace'] && !$.isEmptyObject(occurence['trace'])) {
$('<span title="Call Stack" />')
.text('Stack')
.addClass(csscls('eye'))
.css('cursor', 'pointer')
.on('click', function (e) {
var btn = $(e.target)
var table = btn.next()
if (table.is(':visible')) {
table.hide()
btn.addClass(csscls('eye'))
btn.removeClass(csscls('eye-dash'))
} else {
table.show()
btn.addClass(csscls('eye-dash'))
btn.removeClass(csscls('eye'))
}
})
.appendTo(li)
tableStack = $('<table><thead><tr><th colspan="3">Call Stack</th></tr></thead></table>')
.addClass(csscls('callstack'))
.appendTo(li)
for (var i in occurence['trace']) {
var entry = occurence['trace'][i]
var location = entry[3] ? entry[3].replace(data.jroot, '') + ':' + entry[4] : ''
var caller = entry[2].replace(data.jroot, '')
var cssClass = entry[1] ? 'caller' : ''
if (location && data.xdebugLink) {
location = '<a href="' + data.xdebugLink.replace('%f', entry[3]).replace('%l', entry[4]) + '">' + location + '</a>'
}
tableStack.append('<tr class="' + cssClass + '"><th>' + entry[0] + '</th><td>' + caller + '</td><td>' + location + '</td></tr>')
}
}
li.appendTo(ul)
}
this.$el.append(tr)
}
})
}
})
})(PhpDebugBar.$)

View File

@ -0,0 +1 @@
table.phpdebugbar-widgets-languageStrings{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:1.3em;margin-left:5px;margin-top:5px;width:100%}table.phpdebugbar-widgets-languageStrings th{border-bottom:1px solid #000}table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack{border:1px solid #ddd;border-collapse:collapse;display:none;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;margin:10px;width:100%}table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack tr.caller{background-color:#fff9b6}table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack tbody tr:hover{background-color:#eee}table.phpdebugbar-widgets-languageStrings table.phpdebugbar-widgets-callstack th{font-weight:700}table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye,table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash{color:#888;margin-left:8px}table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash{background-color:#eee;color:#000}table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash:before,table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye:before{font-family:Font Awesome\ 6 Free;margin-right:4px}table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye:before{content:"\f06e"}table.phpdebugbar-widgets-languageStrings span.phpdebugbar-widgets-eye-dash:before{content:"\f070"}

View File

@ -0,0 +1 @@
!function(e){var a=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.languageStringsWidget=PhpDebugBar.Widget.extend({tagName:"table",className:a("languageStrings"),render:function(){this.bindAttr("data",(function(t){for(var r in this.$el.empty(),t.orphans){var l=e("<tr />");e('<th valign="top" style="width:10%" />').text(r).appendTo(l);var s,p=e("<th />").appendTo(l),d=e("<ul />").appendTo(p);for(var n in t.orphans[r]){var i=t.orphans[r][n],c=i.caller.replace(t.jroot,""),o=e("<li />");if(t.xdebugLink){var h=i.caller.split(":"),g=e("<a />").text(c).attr("href",t.xdebugLink.replace("%f",h[0]).replace("%l",h[1]));o.append(g)}else o.text(c);if(i.trace&&!e.isEmptyObject(i.trace))for(var u in e('<span title="Call Stack" />').text("Stack").addClass(a("eye")).css("cursor","pointer").on("click",(function(t){var r=e(t.target),l=r.next();l.is(":visible")?(l.hide(),r.addClass(a("eye")),r.removeClass(a("eye-dash"))):(l.show(),r.addClass(a("eye-dash")),r.removeClass(a("eye")))})).appendTo(o),s=e('<table><thead><tr><th colspan="3">Call Stack</th></tr></thead></table>').addClass(a("callstack")).appendTo(o),i.trace){var b=i.trace[u],v=b[3]?b[3].replace(t.jroot,"")+":"+b[4]:"",f=b[2].replace(t.jroot,""),k=b[1]?"caller":"";v&&t.xdebugLink&&(v='<a href="'+t.xdebugLink.replace("%f",b[3]).replace("%l",b[4])+'">'+v+"</a>"),s.append('<tr class="'+k+'"><th>'+b[0]+"</th><td>"+f+"</td><td>"+v+"</td></tr>")}o.appendTo(d)}this.$el.append(l)}}))}})}(PhpDebugBar.$);

View File

@ -0,0 +1,192 @@
div.phpdebugbar-widgets-sqlqueries .phpdebugbar-widgets-status {
padding: 6px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-weight: bold;
color: #555;
background: #fafafa;
border-bottom: 1px solid #ddd;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-error {
color: #f00;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye-dash,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id {
float: right;
margin-left: 8px;
color: #888;
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link {
float: right;
margin-left: 8px;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-database,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-duration,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-row-count,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-eye,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-eye-dash,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-stmt-id {
color: #555;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye-dash:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before,
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
margin-right: 4px;
font-family: "Font Awesome 6 Free";
font-size: 12px;
font-weight: 900;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before {
content: "\f1c0";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before {
content: "\f017";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before {
content: "\f085";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before {
content: "\f0ce";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
content: "\f08d";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before {
content: "\f0c5";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye:before {
content: "\f06e";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye-dash:before {
content: "\f070";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
margin-left: 4px;
content: "\f08e";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-eye-dash {
padding: 2px;
background-color: #eee;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params {
display: none;
width: 70%;
margin: 10px 0;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border-collapse: collapse;
border: 1px solid #ddd;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params td,
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-explain td {
padding: 3px;
border: 1px solid #ddd;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
width: 20%;
font-weight: bold;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-callstack,
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-explain {
display: none;
width: 100%;
margin: 10px 0;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
border-collapse: collapse;
border: 1px solid #ddd;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-callstack tr.caller {
background-color: #fff9b6;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-callstack tbody tr:hover {
background-color: #eee;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-callstack th,
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-explain th,
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params th {
padding: 3px;
font-weight: bold;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item {
padding: 10px 6px;
border-bottom: 1px solid #00f;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-error {
display: block;
font-weight: bold;
}
code.phpdebugbar-widgets-sql {
word-wrap: break-word;
overflow-wrap: break-word;
white-space: pre-wrap;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #edeff0;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate:hover {
background-color: #ffc;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar {
position: fixed;
bottom: 0;
z-index: 1;
display: none;
width: 100%;
background: #fff;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter {
float: right;
padding: 2px 4px;
margin: 0 2px;
font-size: 12px;
color: #fff;
text-decoration: none;
background: #7cacd5;
border-radius: 4px;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
color: #888;
background: #eee;
}

View File

@ -0,0 +1,348 @@
(function ($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-')
/**
* Widget for the displaying sql queries
*
* Options:
* - data
*/
var SQLQueriesWidget = PhpDebugBar.Widgets.SQLQueriesWidget = PhpDebugBar.Widget.extend({
className: csscls('sqlqueries'),
onFilterClick: function (el) {
$(el).toggleClass(csscls('excluded'))
var excludedLabels = []
this.$toolbar.find(csscls('.filter') + csscls('.excluded')).each(function () {
excludedLabels.push(this.rel)
})
this.$list.$el.find('li[connection=' + $(el).attr('rel') + ']').toggle()
this.set('exclude', excludedLabels)
},
onFilterDupesClick: function (el) {
$(el).toggleClass(csscls('excluded'))
var excludedLabels = []
this.$toolbar.find(csscls('.filter') + csscls('.excluded')).each(function () {
excludedLabels.push(this.rel)
})
this.$list.$el.find('li[dupeindex=' + $(el).attr('rel') + ']').toggle()
this.set('exclude', excludedLabels)
},
onCopyToClipboard: function (el) {
var code = $(el).parent('li').find('code').get(0)
var copy = function () {
try {
document.execCommand('copy')
alert('Query copied to the clipboard')
} catch (err) {
console.log('Oops, unable to copy')
}
}
var select = function (node) {
if (document.selection) {
var range = document.body.createTextRange()
range.moveToElementText(node)
range.select()
} else if (window.getSelection) {
var range = document.createRange()
range.selectNodeContents(node)
window.getSelection().removeAllRanges()
window.getSelection().addRange(range)
}
copy()
window.getSelection().removeAllRanges()
}
select(code)
},
render: function () {
this.$status = $('<div />').addClass(csscls('status')).appendTo(this.$el)
this.$toolbar = $('<div></div>').addClass(csscls('toolbar')).appendTo(this.$el)
var filters = [], self = this
this.$list = new PhpDebugBar.Widgets.ListWidget({
itemRenderer: function (li, stmt) {
$('<code />').addClass(csscls('sql')).html(PhpDebugBar.Widgets.highlight(stmt.sql, 'sql')).appendTo(li)
if (stmt.duration_str) {
$('<span title="Duration" />').addClass(csscls('duration')).text(stmt.duration_str).appendTo(li)
}
if (stmt.memory_str) {
$('<span title="Memory usage" />').addClass(csscls('memory')).text(stmt.memory_str).appendTo(li)
}
if (typeof(stmt.row_count) != 'undefined') {
$('<span title="Row count" />').addClass(csscls('row-count')).text(stmt.row_count).appendTo(li)
}
if (typeof(stmt.stmt_id) != 'undefined' && stmt.stmt_id) {
$('<span title="Prepared statement ID" />').addClass(csscls('stmt-id')).text(stmt.stmt_id).appendTo(li)
}
if (stmt.connection) {
$('<span title="Connection" />').addClass(csscls('database')).text(stmt.connection).appendTo(li)
li.attr('connection', stmt.connection)
if ($.inArray(stmt.connection, filters) == -1) {
filters.push(stmt.connection)
$('<a />')
.addClass(csscls('filter'))
.text(stmt.connection)
.attr('rel', stmt.connection)
.on('click', function () {
self.onFilterClick(this)
})
.appendTo(self.$toolbar)
if (filters.length > 1) {
self.$toolbar.show()
self.$list.$el.css('margin-bottom', '20px')
}
}
}
if (typeof(stmt.is_success) != 'undefined' && !stmt.is_success) {
li.addClass(csscls('error'))
li.append($('<span />').addClass(csscls('error')).text('[' + stmt.error_code + '] ' + stmt.error_message))
}
var tableParams;
function showTableParams() {
if (tableParams) {
tableParams.show();
return;
}
// Render table
tableParams = $('<table>').addClass(csscls('params')).appendTo(li);
tableParams.append('<tr><th colspan="3">Query Parameters</th></tr>');
tableParams.append('<tr><td>ID</td><td>Value</td><td>Data Type</td></tr>');
var pRow;
for (var key in stmt.params) {
pRow = stmt.params[key];
tableParams.append('<tr><td>' + key + '</td><td>' + pRow.value + '</td><td>'
+ pRow.dataType + '</td></tr>');
}
tableParams.show();
}
if (stmt.params && !$.isEmptyObject(stmt.params)) {
var btnParams = $('<span title="Params" />')
.text('Params')
.addClass(csscls('eye'))
.css('cursor', 'pointer')
.on('click', function () {
if (tableParams && tableParams.is(':visible')) {
tableParams.hide()
btnParams.addClass(csscls('eye'))
btnParams.removeClass(csscls('eye-dash'))
} else {
showTableParams();
btnParams.addClass(csscls('eye-dash'))
btnParams.removeClass(csscls('eye'))
}
})
.appendTo(li)
}
var tableExplain;
function showTableExplain() {
if (tableExplain) {
tableExplain.show();
return;
}
// Render table
tableExplain = $('<table>').addClass(csscls('explain')).appendTo(li);
tableExplain.append('<tr><th>' + stmt.explain_col.join('</th><th>') + '</th></tr>');
var i, entry, cols;
for (i in stmt.explain) {
cols = []
entry = stmt.explain[i];
stmt.explain_col.forEach(function (key){
cols.push(entry[key]);
});
tableExplain.append('<tr><td>' + cols.join('</td><td>') + '</td></tr>');
}
tableExplain.show();
}
if (stmt.explain && !$.isEmptyObject(stmt.explain)) {
var btnExplain = $('<span title="Explain" />')
.text('Explain')
.addClass(csscls('eye'))
.css('cursor', 'pointer')
.on('click', function () {
if (tableExplain && tableExplain.is(':visible')) {
tableExplain.hide()
btnExplain.addClass(csscls('eye'))
btnExplain.removeClass(csscls('eye-dash'))
} else {
showTableExplain();
btnExplain.addClass(csscls('eye-dash'))
btnExplain.removeClass(csscls('eye'))
}
})
.appendTo(li)
}
var tableStack;
function showTableStack() {
if (tableStack) {
tableStack.show();
return;
}
// Render table
tableStack = $('<table><tr><th colspan="3">Call Stack</th></tr></table>')
.addClass(csscls('callstack')).appendTo(li);
var i, entry, location, caller, cssClass;
for (i in stmt.callstack) {
entry = stmt.callstack[i]
location = entry[3] ? entry[3].replace(self.root_path, '') + ':' + entry[4] : ''
caller = entry[2].replace(self.root_path, '')
cssClass = entry[1] ? 'caller' : ''
if (location && self.xdebug_link) {
location = '<a href="' + self.xdebug_link.replace('%f', entry[3]).replace('%l', entry[4]) + '">' + location + '</a>'
}
tableStack.append('<tr class="' + cssClass + '"><th>' + entry[0] + '</th><td>' + caller + '</td><td>' + location + '</td></tr>')
}
tableStack.show();
}
if (stmt.callstack && !$.isEmptyObject(stmt.callstack)) {
var btnStack = $('<span title="Call Stack" />')
.text('Stack')
.addClass(csscls('eye'))
.css('cursor', 'pointer')
.on('click', function () {
if (tableStack && tableStack.is(':visible')) {
tableStack.hide()
btnStack.addClass(csscls('eye'))
btnStack.removeClass(csscls('eye-dash'))
} else {
showTableStack();
btnStack.addClass(csscls('eye-dash'))
btnStack.removeClass(csscls('eye'))
}
})
.appendTo(li)
}
if (typeof(stmt.caller) != 'undefined' && stmt.caller) {
var caller = stmt.caller.replace(self.root_path, '')
if (self.xdebug_link) {
var parts = stmt.caller.split(':')
$('<a />')
.text(caller)
.addClass(csscls('editor-link'))
.attr('href', self.xdebug_link.replace('%f', parts[0]).replace('%l', parts[1]))
.appendTo(li)
} else {
$('<span title="Caller" />')
.text(caller)
.addClass(csscls('stmt-id'))
.appendTo(li)
}
}
$('<span title="Copy to clipboard" />')
.text('Copy')
.addClass(csscls('copy-clipboard'))
.css('cursor', 'pointer')
.on('click', function (event) {
self.onCopyToClipboard(this)
event.stopPropagation()
})
.appendTo(li)
li.attr('dupeindex', 'dupe-0')
}
})
this.$list.$el.appendTo(this.$el)
this.bindAttr('data', function (data) {
// the collector maybe is empty
if (data.length <= 0) {
return false
}
this.root_path = data.root_path
this.xdebug_link = data.xdebug_link
this.$list.set('data', data.statements)
this.$status.empty()
// Search for duplicate statements.
for (var sql = {}, unique = 0, duplicate = 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) + '}'
}
sql[stmt] = sql[stmt] || {keys: []}
sql[stmt].keys.push(i)
}
// Add classes to all duplicate SQL statements.
var cnt = 0
for (var stmt in sql) {
if (sql[stmt].keys.length > 1) {
duplicate += sql[stmt].keys.length
cnt++
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'))
.attr('dupeindex', 'dupe-' + cnt)
}
} else {
unique++
}
}
if (duplicate) {
for (i = 0; i <= cnt; i++) {
$('<a />')
.addClass(csscls('filter'))
.text(i ? 'Duplicates ' + i : 'Uniques')
.attr('rel', 'dupe-' + i)
.on('click', function () {
self.onFilterDupesClick(this)
})
.appendTo(self.$toolbar)
}
self.$toolbar.show()
self.$list.$el.css('margin-bottom', '20px')
}
var t = $('<span />').text(data.nb_statements + ' statements were executed').appendTo(this.$status)
if (data.nb_failed_statements) {
t.append(', ' + data.nb_failed_statements + ' of which failed')
}
if (duplicate) {
t.append(', ' + duplicate + ' of which were duplicates')
t.append(', ' + unique + ' unique')
}
if (data.accumulated_duration_str) {
this.$status.append($('<span title="Accumulated duration" />').addClass(csscls('duration')).text(data.accumulated_duration_str))
}
if (data.memory_usage_str) {
this.$status.append($('<span title="Memory usage" />').addClass(csscls('memory')).text(data.memory_usage_str))
}
})
}
})
})(PhpDebugBar.$)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long