-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Debug bar #20380
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
[4.0] Debug bar #20380
Changes from 44 commits
7f5956e
5bd2778
16931de
c315796
9840d77
c0365c9
caf06a0
aada087
c3c63e5
d0fa5f0
0f81024
cf5e1ce
f0d7c0b
5272e5c
fbc964b
f9a18ec
6a54a16
6391414
2a505e9
c7f9f46
ad4f622
6ffa5fb
6c32d6b
a6251dd
44412b1
3da748d
80e077f
c4d1c12
869e6f6
6ebe793
e2ce6e5
52bd91f
0ca6d06
1f3badc
2ccb844
296fc69
81b56fc
2402030
bb4cc1c
7954e8b
6aff483
22ff915
4fd63c7
69ab395
7f90136
282c12b
04ec732
398639c
64e56f1
cac840a
0f596d0
2b91400
a43c4df
159e318
215655e
0df391b
bab8e58
94916d2
f9111c6
a4f7e15
b68a26e
a9e4ace
902843b
1daa740
a04db00
b8b9464
41ce3ed
5e567ae
a351da1
ea46629
6447436
6102603
e59d900
4a80ad4
ee2d518
8402e95
fdfe5cc
5e406c3
cc8153a
4f184ca
7506f4a
9ee8fc8
7c90d4d
96c2870
ed51556
58d7104
aa08caf
0e9ccdf
ecbb27c
ef1441d
9b78c9b
ba623e4
ba07b6a
003e5a8
b91ec80
6705c32
de1469f
84fff04
ce941e7
f2b890c
ec65393
eb8cafc
cea53f0
234b2f7
391f3b9
b5f6fc8
a68cf20
e9061a1
9e08267
75247d0
d9ec1d2
3211dfe
87c1fd4
3a931a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| table.phpdebugbar-widgets-info { | ||
| margin-left: 5px; | ||
| margin-top: 5px; | ||
| } | ||
|
|
||
| table.phpdebugbar-widgets-info td { | ||
| border-bottom: 1px solid silver; | ||
| padding-right: 10px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| (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; | ||
|
|
||
| var link = $('<a />') | ||
| .text('Info') | ||
| .attr('href', 'index.php?option=com_profiler&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); | ||
| }); | ||
| } | ||
| }); | ||
| })(PhpDebugBar.$); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| table.phpdebugbar-widgets-languageFiles { | ||
| margin-left: 5px; | ||
| margin-top: 5px; | ||
| } | ||
|
|
||
| table.phpdebugbar-widgets-languageFiles tr { | ||
| border-bottom: 1px solid silver; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| (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 tr; | ||
| for (var extension in data) { | ||
| var ul = $('<ul />'); | ||
| for (var file in data[extension]) { | ||
| var css = data[extension][file] ? 'alert-success' : 'alert-warning'; | ||
| var li = $('<li />') | ||
| .addClass(css) | ||
| .text(file).appendTo(ul); | ||
| } | ||
| tr = $('<tr />') | ||
| .append($('<td />').text(extension)) | ||
| .append($('<td />').append(ul)); | ||
| this.$el.append(tr); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| })(PhpDebugBar.$); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Plugin | ||
| * @subpackage System.Debug | ||
| * | ||
| * @copyright Copyright (C) 2017 Open Source Matters, Inc. All rights reserved. | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\Plugin\System\Debug; | ||
|
|
||
| use DebugBar\DataCollector\DataCollector; | ||
| use DebugBar\DataCollector\Renderable; | ||
| use DebugBar\DataFormatter\DataFormatterInterface; | ||
| use Joomla\Registry\Registry; | ||
|
|
||
| /** | ||
| * AbstractDataCollector | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| abstract class AbstractDataCollector extends DataCollector implements Renderable | ||
| { | ||
| /** | ||
| * @var Registry | ||
|
||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected $params; | ||
|
|
||
| /** | ||
| * @var DataFormatter | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| private static $defaultDataFormatter; | ||
|
|
||
| /** | ||
| * AbstractDataCollector constructor. | ||
| * | ||
| * @param Registry $params Parameters. | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function __construct(Registry $params) | ||
| { | ||
| $this->params = $params; | ||
| } | ||
|
|
||
| /** | ||
| * Get a data formatter. | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| * @return DataFormatterInterface | ||
| */ | ||
| public function getDataFormatter(): DataFormatterInterface | ||
| { | ||
| if ($this->dataFormater === null) | ||
| { | ||
| $this->dataFormater = self::getDefaultDataFormatter(); | ||
| } | ||
|
|
||
| return $this->dataFormater; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the default data formater | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| * @return DataFormatterInterface | ||
| */ | ||
| public static function getDefaultDataFormatter(): DataFormatterInterface | ||
| { | ||
| if (self::$defaultDataFormatter === null) | ||
| { | ||
| self::$defaultDataFormatter = new DataFormatter; | ||
| } | ||
|
|
||
| return self::$defaultDataFormatter; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to use one of the other methods in this file. The reason is that we want to keep the convention
vendor/name/js. Mind the lastjsfolder. This enables joomla's HTMLHelper::script() to override the scripts if one is found in the relevant template folder (egtemplates/some-template/js/vendor/name/some-script.js).Just add a @todo above the line and I will do the rest once this is merged!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's just about the
/jsfolder I guess I could just add that to thedestpath of the copy command and adjust my path?I am more concerned about the fact that somebody could run
npm ibefore runningcomposer installso the copy command here would obviously fail...It just feels that stuff is done in the
wrong_place™In the mean time I have added a
@todoand feel good having that working (again)Thanks for your help and keep up the good work 🕺