diff --git a/administrator/language/en-GB/en-GB.plg_system_debug.ini b/administrator/language/en-GB/en-GB.plg_system_debug.ini index 1ededccde7b7c..d287b3e8cb955 100644 --- a/administrator/language/en-GB/en-GB.plg_system_debug.ini +++ b/administrator/language/en-GB/en-GB.plg_system_debug.ini @@ -11,7 +11,6 @@ PLG_DEBUG_CALL_STACK_SAME_FILE="Same as call in the line below." PLG_DEBUG_ERRORS="Errors" PLG_DEBUG_EXPLAIN="Explain" PLG_DEBUG_FIELD_ALLOWED_GROUPS_LABEL="Allowed Groups" -PLG_DEBUG_FIELD_EXECUTEDSQL_LABEL="Log Executed Queries" PLG_DEBUG_FIELD_LANGUAGE_ERRORFILES_LABEL="Errors When Parsing Language Files" PLG_DEBUG_FIELD_LANGUAGE_FILES_LABEL="Language Files" PLG_DEBUG_FIELD_LANGUAGE_STRING_LABEL="Language String" @@ -21,6 +20,7 @@ PLG_DEBUG_FIELD_LOG_CATEGORIES_LABEL="Log Categories" PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_EXCLUDE="Exclude" PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_INCLUDE="Include" PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_LABEL="Log Category Mode" +PLG_DEBUG_FIELD_LOG_DEPRECATED_CORE_LABEL="Log Deprecated Core API" PLG_DEBUG_FIELD_LOG_DEPRECATED_LABEL="Log Deprecated API" PLG_DEBUG_FIELD_LOG_EVERYTHING_LABEL="Log Almost Everything" PLG_DEBUG_FIELD_LOG_PRIORITIES_ALERT="Alert" @@ -36,9 +36,12 @@ PLG_DEBUG_FIELD_LOG_PRIORITIES_WARNING="Warning" PLG_DEBUG_FIELD_MEMORY_LABEL="Memory Usage" PLG_DEBUG_FIELD_PROFILING_LABEL="Profiling" PLG_DEBUG_FIELD_QUERIES_LABEL="Queries" -PLG_DEBUG_FIELD_QUERY_TYPES_LABEL="Query Types" +PLG_DEBUG_FIELD_QUERY_EXPLAINS_LABEL="Query Explains" +PLG_DEBUG_FIELD_QUERY_PROFILES_LABEL="Query Profiles" +PLG_DEBUG_FIELD_QUERY_TRACES_LABEL="Query Traces" PLG_DEBUG_FIELD_REFRESH_ASSETS_DESC="If enabled will, on each page reload, add a different hash to every script/stylesheet file with auto version so that they never use the browser cache." PLG_DEBUG_FIELD_REFRESH_ASSETS_LABEL="Refresh Assets" +PLG_DEBUG_FIELD_REQUEST_LABEL="Request" PLG_DEBUG_FIELD_SESSION_LABEL="Session Data" PLG_DEBUG_FIELD_STRIP_FIRST_LABEL="Strip First Word" PLG_DEBUG_FIELD_STRIP_PREFIX_DESC="Strip words from the beginning of the string. For multiple words, use the format: (word1|word2)." diff --git a/build/build-modules-js/update.js b/build/build-modules-js/update.js index f22b93f6062fc..764e265204812 100644 --- a/build/build-modules-js/update.js +++ b/build/build-modules-js/update.js @@ -21,6 +21,10 @@ const cleanVendors = () => { fsExtra.copySync(Path.join(rootPath, 'build/media/vendor/tinymce/langs'), Path.join(rootPath, 'media/vendor/tinymce/langs')); fsExtra.copySync(Path.join(rootPath, 'build/media/vendor/tinymce/templates'), Path.join(rootPath, 'media/vendor/tinymce/templates')); fsExtra.copySync(Path.join(rootPath, 'build/media/vendor/jquery-ui'), Path.join(rootPath, 'media/vendor/jquery-ui')); + + // And here some assets from a PHP package + // @todo Move it the 'right way' (tm) + fsExtra.copySync(Path.join(rootPath, 'libraries/vendor/maximebf/debugbar/src/DebugBar/Resources'), Path.join(rootPath, 'media/vendor/debugbar')); }; // Copies all the files from a directory diff --git a/build/media/plg_system_debug/css/debug.css b/build/media/plg_system_debug/css/debug.css index 073ceb2b0947a..9d1848062a2bd 100644 --- a/build/media/plg_system_debug/css/debug.css +++ b/build/media/plg_system_debug/css/debug.css @@ -3,210 +3,12 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -/* Common CSS for system debug */ -div#system-debug { - clear: both; +/* Debug Bar */ +.phpdebugbar-badge { + color: white !important; + background-color: rgb(40,70,106) !important; } -#system-debug { - background-color: #fff; - color: #000; - border: 1px dashed silver; - padding: 10px; +div.phpdebugbar-header, a.phpdebugbar-restore-btn { + background: #efefef url("data:image/svg+xml;utf8,") no-repeat 5px 4px / 20px 20px !important; } - -#system-debug div.dbg-header { - background-color: #ddd; - border: 1px solid #eee; - font-size: 16px; -} - -#system-debug h3 { - margin: 0; -} - -#system-debug a h3 { - background-color: #ddd; - color: #000; - font-size: 14px; - padding: 5px; - text-decoration: none; - margin: 0px; -} - -#system-debug .dbg-error a h3 { - background-color: red; -} - -#system-debug a:hover h3, -#system-debug a:focus h3 { - background-color: #4d4d4d; - color: #ddd; - font-size: 14px; - cursor: pointer; - text-decoration: none; -} - -#system-debug div.dbg-container { - display: none; - padding: 10px; -} - -#system-debug span.dbg-command { - color: blue; - font-weight: bold; -} - -#system-debug span.dbg-table { - color: green; - font-weight: bold; -} - -#system-debug b.dbg-operator { - color: red; - font-weight: bold; -} - -#system-debug h1 { - background-color: #2c2c2c; - color: #fff; - padding: 10px; - margin: 0; - font-size: 16px; - line-height: 1em; -} - -#system-debug h4 { - font-size: 14px; - font-weight: bold; - margin: 5px 0 0 0; -} - -#system-debug h5 { - font-size: 13px; - font-weight: bold; - margin: 5px 0 0 0; -} - -div#system-debug { - margin: 5px; -} - -#system-debug ol { - margin-left: 25px; - margin-right: 25px; - text-align: left; - direction: ltr; -} - -#system-debug ul { - list-style: none; - text-align: left; - direction: ltr; -} - -#system-debug li { - font-size: 13px; - margin-bottom: 10px; -} - -#system-debug code { - font-size: 13px; - text-align: left; - direction: ltr; -} - -#system-debug p { - font-size: 13px; -} - -#system-debug div.dbg-header.dbg-error { - background-color: red; -} -#system-debug .dbg-warning { - color: red; - font-weight: bold; - background-color: #ffffcc !important; -} - -#system-debug .accordion { - margin-bottom: 0; -} -#system-debug .dbg-noprofile { - text-decoration: line-through; -} - -/* dbg-bars */ -#system-debug .alert, -#system-debug .dbg-bars { - margin-bottom: 10px; -} -#system-debug .dbg-bar-spacer { - float: left; - height: 100%; -} -/* dbg-bars-query */ -#system-debug .dbg-bars-query .dbg-bar { - opacity: 0.3; - height: 12px; - margin-top: 3px; -} -#system-debug .dbg-bars-query:hover .dbg-bar { - opacity: 0.6; - height: 18px; - margin-top: 0; -} -#system-debug .dbg-bars-query .dbg-bar:hover, -#system-debug .dbg-bars-query .dbg-bar-active, -#system-debug .dbg-bars-query:hover .dbg-bar-active { - opacity: 1; - height: 18px; - margin-top: 0; -} - -/* dbg-query-table */ -#system-debug table.dbg-query-table { - margin: 0px 0px 6px; -} -#system-debug table.dbg-query-table th, -#system-debug table.dbg-query-table td { - padding: 3px 8px; -} - -#system-debug .dbg-profile-list .label { - display: inline-block; - min-width: 60px; - text-align: right; -} - -#system-debug .dbg-query-memory, -#system-debug .dbg-query-rowsnumber -{ - margin-left: 50px; -} -#dbg_container_session pre -{ - background: white; - border: 0; - margin: 0; - padding: 0; - overflow-wrap: break-word; - white-space: pre-wrap; - word-break: break-word; -} -#dbg_container_session pre .blue -{ - color:blue; -} -#dbg_container_session pre .green -{ - color:green; -} -#dbg_container_session pre .black -{ - color:black; -} -#dbg_container_session pre .grey -{ - color:grey; -} \ No newline at end of file diff --git a/build/media/plg_system_debug/widgets/info/widget.css b/build/media/plg_system_debug/widgets/info/widget.css new file mode 100644 index 0000000000000..dde61d6a012e2 --- /dev/null +++ b/build/media/plg_system_debug/widgets/info/widget.css @@ -0,0 +1,32 @@ +table.phpdebugbar-widgets-info { + margin-left: 5px; + margin-top: 5px; + width: 75%; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 1.3em; +} + +table.phpdebugbar-widgets-info td { + border-bottom: 1px solid silver; + padding-right: 10px; +} + +table.phpdebugbar-widgets-info dt { + float: left; + width: 30%; + text-align: left; + padding: .25em; + clear: left; +} + +table.phpdebugbar-widgets-info dd { + float: left; + width: 60%; + padding: .25em 0; +} + +table.phpdebugbar-widgets-info dl:after { + content: ""; + display: table; + clear: both; +} diff --git a/build/media/plg_system_debug/widgets/info/widget.js b/build/media/plg_system_debug/widgets/info/widget.js new file mode 100644 index 0000000000000..e8c16627de6be --- /dev/null +++ b/build/media/plg_system_debug/widgets/info/widget.js @@ -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 = $('') + .text('Info') + .attr('href', 'index.php?option=com_content&view=debug&id=' + data.requestId) + .attr('target', '_blank'); + + tr = $('') + .append($('').text('Info')) + .append($('').append(link)); + this.$el.append(tr); + */ + + tr = $('') + .append($('').text('Joomla! Version')) + .append($('').text(data.joomlaVersion)) + this.$el.append(tr) + + tr = $('') + .append($('').text('PHP Version')) + .append($('').text(data.phpVersion)) + this.$el.append(tr) + + tr = $('') + .append($('').text('Identity')) + .append($('').text(data.identity.type)) + this.$el.append(tr) + + tr = $('') + .append($('').text('Response')) + .append($('').text(data.response.status_code)) + this.$el.append(tr) + + tr = $('') + .append($('').text('Template')) + .append($('').text(data.template.template)) + this.$el.append(tr) + + tr = $('') + .append($('').text('Database')) + .append($('').html( + '
' + + '
Server
' + data.database.dbserver + '
' + + '
Version
' + data.database.dbversion + '
' + + '
Collation
' + data.database.dbcollation + '
' + + '
Conn Collation
' + data.database.dbconnectioncollation + '
' + + '
' + )) + this.$el.append(tr) + }) + } + }) +})(PhpDebugBar.$) diff --git a/build/media/plg_system_debug/widgets/languageErrors/widget.css b/build/media/plg_system_debug/widgets/languageErrors/widget.css new file mode 100644 index 0000000000000..2be07985cad15 --- /dev/null +++ b/build/media/plg_system_debug/widgets/languageErrors/widget.css @@ -0,0 +1,6 @@ +ul.phpdebugbar-widgets-languageErrors { + margin-left: 5px; + margin-top: 5px; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 1.3em; +} diff --git a/build/media/plg_system_debug/widgets/languageErrors/widget.js b/build/media/plg_system_debug/widgets/languageErrors/widget.js new file mode 100644 index 0000000000000..1d59626945681 --- /dev/null +++ b/build/media/plg_system_debug/widgets/languageErrors/widget.js @@ -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 = $('
  • ') + if (data.xdebugLink) { + var link = $('') + .text(relPath + ':' + file[1]) + .attr( + 'href', + data.xdebugLink + .replace('%f', file[0]) + .replace('%l', file[1]) + ) + li.append(link) + } else { + li.text(relPath) + } + this.$el.append(li) + } + }) + } + }) +})(PhpDebugBar.$) diff --git a/build/media/plg_system_debug/widgets/languageFiles/widget.css b/build/media/plg_system_debug/widgets/languageFiles/widget.css new file mode 100644 index 0000000000000..7b9d09f909c2c --- /dev/null +++ b/build/media/plg_system_debug/widgets/languageFiles/widget.css @@ -0,0 +1,15 @@ +table.phpdebugbar-widgets-languageFiles { + margin-left: 5px; + margin-top: 5px; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 1.3em; +} + +table.phpdebugbar-widgets-languageFiles tr { + border-bottom: 1px solid silver; +} + +table.phpdebugbar-widgets-languageFiles th { + font-weight: bold; + padding: 5px; +} diff --git a/build/media/plg_system_debug/widgets/languageFiles/widget.js b/build/media/plg_system_debug/widgets/languageFiles/widget.js new file mode 100644 index 0000000000000..43496f58f90e4 --- /dev/null +++ b/build/media/plg_system_debug/widgets/languageFiles/widget.js @@ -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 = $('') + .append($('').text('Extension')) + .append($('').text('File')) + this.$el.append(head) + for (var extension in data.loaded) { + var ul = $('