Skip to content

Commit 805e09c

Browse files
committed
Add SQL query to Selector Queries section of Debug Mode panel. Tweak to hopefully fix Console panel not opening fully sometimes. Disable zoom on icons in docs.
1 parent 91cdf3b commit 805e09c

File tree

5 files changed

+50
-48
lines changed

5 files changed

+50
-48
lines changed

TracyDebugger.module

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
3232
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
3333
'author' => 'Adrian Jones',
3434
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
35-
'version' => '4.9.8',
35+
'version' => '4.9.9',
3636
'autoload' => true,
3737
'singular' => true,
3838
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
@@ -55,7 +55,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
5555
public static $isLocal = false;
5656
public static $tracyVersion;
5757
public static $dumpItems = array();
58-
public static $selectors = array();
58+
public static $pageFinderQueries = array();
5959
public static $templateVars = array();
6060
public static $templateConsts = array();
6161
public static $initialFuncs = array();
@@ -351,7 +351,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
351351
}
352352

353353

354-
// Various features that require an early $session->redirect() so do now before loading Tracy core files
354+
// Various features that can be run before loading Tracy core files
355355
if($this->allowedTracyUsers() === 'development') {
356356

357357
// PANELS TO DISPLAY
@@ -378,12 +378,12 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
378378

379379
if(in_array('debugMode', static::$showPanels)) {
380380
// Selectors for Debug Mode panel
381-
$this->addHookBefore('Pages::find', null, function($event) {
381+
$this->addHookBefore('PageFinder::getQuery', null, function($event) {
382382
$this->timerkey = Debug::timer();
383383
});
384-
$this->addHookAfter('Pages::find', null, function($event) {
384+
$this->addHookAfter('PageFinder::getQuery', null, function($event) {
385385
$event->setArgument(2, Debug::timer($this->timerkey));
386-
static::$selectors[] = $event->arguments;
386+
static::$pageFinderQueries[] = $event;
387387
});
388388
}
389389

docs/_coverpage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![logo](img/icon.svg)
1+
![logo](img/icon.svg ':no-zoom')
22

33
# Tracy Debugger for ProcessWire
44

@@ -10,7 +10,7 @@ Integrates and extends Nette's Tracy debugging tool
1010

1111
<br />
1212

13-
![Tracy Debug Bar Kitchen Sink](img/debug-bar-kitchen-sink.png "Tracy Debug Bar")
13+
![Tracy Debug Bar Kitchen Sink](img/debug-bar-kitchen-sink.png 'Tracy Debug Bar :no-zoom')
1414

1515
<br />
1616
<a class="github-button" href="https://github.com/adrianbj/TracyDebugger" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star adrianbj/TracyDebugger on GitHub">Star</a>

docs/debug-bar.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Debug Bar
22
The debug bar shows non-fatal errors, dumps, and provides access to all the custom panels/tools for ProcessWire development. You can set the default panels for both frontend and backend versions of the bar and also add / remove them on-the-fly via the [Panel Selector](#panel-selector).
33

4-
![Tracy Debug Bar Kitchen Sink](img/debug-bar-kitchen-sink.png "Tracy Debug Bar")
4+
![Tracy Debug Bar Kitchen Sink](img/debug-bar-kitchen-sink.png 'Tracy Debug Bar')
55

6-
## ![Captain Hook](icons/captain-hook.svg)Captain Hook
6+
## ![Captain Hook](icons/captain-hook.svg ':no-zoom')Captain Hook
77
Generates a list of hookable methods in your ProcessWire install, including site modules.
88

99
Results are cached for speed, but will be updated whenever you update your ProcessWire version or install a new module.
@@ -16,7 +16,7 @@ Results are cached for speed, but will be updated whenever you update your Proce
1616

1717
***
1818

19-
## ![Console](icons/console.svg)Console
19+
## ![Console](icons/console.svg ':no-zoom')Console
2020

2121
* Code highlighting and syntax checking
2222
* Access to all PW variables: $pages, $page, $user, etc
@@ -40,7 +40,7 @@ Remember that this allows you to run any PHP code, so be careful!
4040

4141
***
4242

43-
## ![Custom PHP](icons/custom-php.svg)Custom PHP
43+
## ![Custom PHP](icons/custom-php.svg ':no-zoom')Custom PHP
4444
This panel lets you output anything you want. Primarily I see this being used for creating links to things like Google PageSpeed, but use your imagination.
4545

4646
```php
@@ -51,7 +51,7 @@ return '<a href="https://developers.google.com/speed/pagespeed/insights/?url='.$
5151

5252
***
5353

54-
## ![Debug Mode](icons/debug-mode.svg)Debug Mode
54+
## ![Debug Mode](icons/debug-mode.svg ':no-zoom')Debug Mode
5555
Provides access to most of the information that is available in the back-end "Debug Mode Tools" section of your PW admin. This panel makes it available on the front-end and even when Debug Mode is off. Note that with Debug Mode Off, you won't have access to the "Database Queries", "Timers", and "Autload" sections. This is a ProcessWire core restriction.
5656

5757
Other information from the back-end "Debug Mode Tools" (POST, GET, REQUEST, COOKIE, SESSION) have been moved to the [Request Info Panel](#request-info).
@@ -62,7 +62,7 @@ The icon color on the debug bar is red when debug mode is on and green when it i
6262

6363
***
6464

65-
## ![Diagnostics](icons/diagnostics.svg)Diagnostics
65+
## ![Diagnostics](icons/diagnostics.svg ':no-zoom')Diagnostics
6666
### Filesystem Folders
6767
Overview of the filesystem access permissions for all the key folders and files in your PW install. It also provides status and notes about these. These should not be taken as definitive (especially if you are on a Windows system), but rather as a guide and reminder to check these. The debug bar icon for this panel is colored to match the most serious status level - OK, Warning, or Failure.
6868

@@ -78,7 +78,7 @@ Some basic details about your MySQL server and client setup.
7878

7979
***
8080

81-
## ![Dumps](icons/dumps.svg)Dumps
81+
## ![Dumps](icons/dumps.svg ':no-zoom')Dumps
8282
This panel is only displayed when you have called the barDump() method and contains the contents of that dump.
8383

8484
Note the second optional parameter used to name the outputs in the Dumps panel.
@@ -94,19 +94,19 @@ bd(array('a' => array(1,2,3), 'b' => array(4,5,6)), 'Test Array');
9494
9595
***
9696

97-
## ![Dumps Recorder](icons/dumps-recorder.svg)Dumps Recorder
97+
## ![Dumps Recorder](icons/dumps-recorder.svg ':no-zoom')Dumps Recorder
9898
If this panel is enabled, any calls to bd() will be sent to this panel instead of the main dumps panel. This is useful in several situations where you want to compare dumps from various page requests. Dumps will be preserved until the session is closed, or until you click the "Clear Dumps" button. It can also be useful in some situations where dumps are not being captured with the regular dumps panel which can sometimes happen with modules, complex redirects, or other scenarios that are hard to pin down.
9999

100100
***
101101

102-
## ![Errors](icons/errors.svg)Errors
102+
## ![Errors](icons/errors.svg ':no-zoom')Errors
103103
The errors panel is only displayed when there are non-fatal errors and you are not in Strict Mode. All PHP notices and warnings will be displayed in this panel.
104104

105105
![Errors panel](img/errors.png)
106106

107107
***
108108

109-
## ![Event Interceptor](icons/event-interceptor.svg)Event Interceptor
109+
## ![Event Interceptor](icons/event-interceptor.svg ':no-zoom')Event Interceptor
110110

111111
> This panel lets you define any Hook that you want to intercept.
112112
@@ -135,7 +135,7 @@ For example, setting the hook to `Pages::save` and then deleting a page can resu
135135

136136
***
137137

138-
## ![File Editor](icons/file-editor.svg)File Editor
138+
## ![File Editor](icons/file-editor.svg ':no-zoom')File Editor
139139

140140
* Supports editing all files in your PW install (you can define the root as /, /site, or /site/templates
141141
* Can be used as the handler for opening editor links from the debug bar (errors, log files, Captain Hook, ToDo, Template editor, etc), rather than your code editor
@@ -163,29 +163,29 @@ For example, setting the hook to `Pages::save` and then deleting a page can resu
163163

164164
***
165165

166-
## ![Git Info](icons/git-info.svg)Git Info
166+
## ![Git Info](icons/git-info.svg ':no-zoom')Git Info
167167

168168
Displays the Git branch, latest commit message, etc for your site (assuming you have it under Git version control).
169169

170170
![Git Info panel](img/git-info.png)
171171

172172
***
173173

174-
## ![Mail Interceptor](icons/mail-interceptor.svg)Mail Interceptor
174+
## ![Mail Interceptor](icons/mail-interceptor.svg ':no-zoom')Mail Interceptor
175175
Intercepts all outgoing emails sent using `wireMail()` and displays them in the panel. Ideal for form submission testing. This panel is activated when enabled, so it's best to enable it from the Panel Selector using the sticky option when needed.
176176

177177
![Mail Interceptor Panel](img/mail-interceptor.png)
178178

179179
***
180180

181-
## ![Methods Info](icons/methods-info.svg)Methods Info
181+
## ![Methods Info](icons/methods-info.svg ':no-zoom')Methods Info
182182
Lists available logging methods you can call in your PHP code.<br />Links to Tracy Debugger docs (this site) and [Tracy Nette docs](https://tracy.nette.org/)
183183

184184
![Methods Info panel](img/methods-info.png)
185185

186186
***
187187

188-
## ![Module Disabler](icons/module-disabler.svg)Module Disabler
188+
## ![Module Disabler](icons/module-disabler.svg ':no-zoom')Module Disabler
189189
This panel makes use of the ProcessWire core "disabled" flag for disabling autoload modules for testing / debugging purposes. It can potentially result in a fatal error on your site (this is a ProcessWire core issue, rather than specific to this panel). Because of this, it is only available when ProcessWire's advanced and debug modes are enabled.
190190

191191
If you do end up with a fatal error after disabling a module, this panel provides a script for automatically restoring the modules database table. Whenever you disable any modules, a backup of the "modules" database table is automatically saved.
@@ -202,7 +202,7 @@ Execute "/site/assets/cache/TracyDebugger/modulesBackup.sql" manually (via PHPMy
202202

203203
***
204204

205-
## ![Output Mode](icons/output-mode.svg)Output Mode
205+
## ![Output Mode](icons/output-mode.svg ':no-zoom')Output Mode
206206
Indicates which mode Tracy is in - DEVELOPMENT or PRODUCTION - this is determined at runtime so if you have configured it to "Detect" mode, you can easily see which mode it has automatically switched to. This is useful if you have the "Superuser Force Development Mode" option enabled because you will see the debug bar even in Production mode.
207207

208208
![Output Mode panel](img/output-mode.png)
@@ -212,7 +212,7 @@ Indicates which mode Tracy is in - DEVELOPMENT or PRODUCTION - this is determine
212212
***
213213

214214

215-
## ![Page Recorder](icons/page-recorder.svg)Page Recorder
215+
## ![Page Recorder](icons/page-recorder.svg ':no-zoom')Page Recorder
216216
This panel records the ID of all pages added whenever it is enabled (so this is one you'll want off by default and just enabled via "Sticky" when you need it).
217217

218218
This is perfect for all sorts of testing, whether you need to create a LOT of pages for performance testing or you are testing a form which is automatically creating pages. Once you are done with the testing session, simply click the "Trash Recorded Pages" button and they will all be moved to the Trash.
@@ -223,7 +223,7 @@ If you decide you want to keep the pages, you can click "Clear Recorded Pages Li
223223

224224
***
225225

226-
## ![Panel Selector](icons/panel-selector.svg)Panel Selector
226+
## ![Panel Selector](icons/panel-selector.svg ':no-zoom')Panel Selector
227227
Allows you to set up a default set of panels in the module config settings and then easily enable / disable other panels from the debugger bar.
228228

229229
Your page loading speed will be better if you limit the default panels to those you use all the time and load others as needed via this selector.
@@ -243,7 +243,7 @@ There are indicators if:
243243

244244
***
245245

246-
## ![Performance](icons/performance.svg)Performance
246+
## ![Performance](icons/performance.svg ':no-zoom')Performance
247247
Performance Panel is a third party extension for Tracy developed by Martin Jirásek. It adds support for inserting named breakpoints in your code and reports execution time and various memory usages stats between the various breakpoints. This is where calls to addBreakpoint() are rendered.
248248

249249
```
@@ -264,7 +264,7 @@ bp('D');
264264

265265
***
266266

267-
## ![PHP Info](icons/php-info.svg)PHP Info
267+
## ![PHP Info](icons/php-info.svg ':no-zoom')PHP Info
268268
Provides all the output from PHP's `phpinfo()`. Probable best to leave disabled unless you need to check something.
269269

270270
CTRL/CMD+F works well to find relevant entries within this panel (and all panels actually), although this seems to be browser specific. It works in Chrome and Safari, but not Firefox.
@@ -273,21 +273,21 @@ CTRL/CMD+F works well to find relevant entries within this panel (and all panels
273273

274274
***
275275

276-
## ![ProcessWire Info](icons/processwire-info.svg)Processwire Info
276+
## ![ProcessWire Info](icons/processwire-info.svg ':no-zoom')Processwire Info
277277
Provides a wide variety of links, information and search features for all things ProcessWire.
278278

279279
![ProcessWire Info panel](img/processwire-info.png)
280280

281281
***
282282

283-
## ![ProcessWire Logs](icons/processwire-logs.svg)ProcessWire Logs
283+
## ![ProcessWire Logs](icons/processwire-logs.svg ':no-zoom')ProcessWire Logs
284284
Displays the most recent entries across all ProcessWire log files with links to view the log in the PW logs viewer, as well as direct links to view each entry in your code editor. By default it shows the last 10, but this can be changed in the config settings. A red icon indicates the last page load contained an errors or exceptions log entry. An orange icon is for all other log types.
285285

286286
![ProcessWire Logs panel](img/processwire-logs.png)
287287

288288
***
289289

290-
## ![ProcessWire Version](icons/processwire-version.svg)ProcessWire Version
290+
## ![ProcessWire Version](icons/processwire-version.svg ':no-zoom')ProcessWire Version
291291
Lets you instantly switch your PW version. This is probably most useful for module developers, but can also be helpful for other users to help debug PW core or module problems. It's probably obvious, but the switcher is not recommended for live sites, so don't blame me if a version change breaks your site (especially between the 2.x and 3.x branch)!
292292

293293
The available versions come from Ryan's ProcessWire Upgrades module - so any version that you installed via it will be available.
@@ -300,7 +300,7 @@ The icon is green when you are using the latest version that is available on you
300300

301301
***
302302

303-
## ![Request Info](icons/request-info.svg)Request Info
303+
## ![Request Info](icons/request-info.svg ':no-zoom')Request Info
304304

305305
Provides very detailed infomation and links related to the current page. It contains several expandable sections listed below.
306306

@@ -323,7 +323,7 @@ Here is another example showing three different image fields; images (with Maxim
323323

324324
***
325325

326-
## ![Snippet Runner](icons/snippet-runner.svg)Snippet Runner
326+
## ![Snippet Runner](icons/snippet-runner.svg ':no-zoom')Snippet Runner
327327
This is similar to the [Console Panel](#console), but instead lets you run snippets stored on the server's filesystem which allows for easier version control, and also for editing snippets in your code editor. It has access to all the same ProcessWire system variables that the Console panel has, so please see it's documentation for details.
328328

329329
Snippets can be stored in either of these. Visit the config settings to set which you prefer. You can also make use of subfolders to categorize your snippets.
@@ -334,14 +334,14 @@ Snippets can be stored in either of these. Visit the config settings to set whic
334334

335335
***
336336

337-
## ![System Info](icons/system-info.svg)System Info
337+
## ![System Info](icons/system-info.svg ':no-zoom')System Info
338338
Provides a table of basic stats about the current page and your system.
339339

340340
![System Info panel](img/system-info.png)
341341

342342
***
343343

344-
## ![Template Path](icons/template-path.svg)Template Path
344+
## ![Template Path](icons/template-path.svg ':no-zoom')Template Path
345345
The template path panel allows you to temporarily choose an alternate template file for rendering the current page. It provides a list of files in the site/templates folder that match the name of the default template file, but with a "-suffix" extension. You can have several different versions and quickly test each one. You can make the change last for the browser session (sticky), or just for one reload (once). You can reset to the default template file for the current page, or all changes you may have made to other pages/template files on the site.
346346

347347
Not only is this useful for debugging (especially on a live production server), but it could also be used for sharing different versions of a page among trusted users.
@@ -377,7 +377,7 @@ If you are on a page that is using an alternate template due to user permissions
377377

378378
***
379379

380-
## ![Template Resources](icons/template-resources.svg)Template Resources
380+
## ![Template Resources](icons/template-resources.svg ':no-zoom')Template Resources
381381
Displays the names, types, and values of all variables defined in the template file (and any other included files) for the current page. It also shows any defined constants and functions (linked to open in your code editor), as well as a list of included files (also linked to open in your code editor).
382382

383383
![Template Resources panel 1](img/template-resources-1.png)
@@ -386,7 +386,7 @@ Displays the names, types, and values of all variables defined in the template f
386386

387387
***
388388

389-
## ![TODO](icons/todo.svg)Todo
389+
## ![TODO](icons/todo.svg ':no-zoom')Todo
390390
The ToDo Panel report the following comment types: 'todo', 'fixme', 'pending', 'xxx', 'hack', 'bug'. See the config settings for determining which folders and files will be scanned.
391391

392392
If you have your editor configured, the comment text link opens the file to the line of the comment.
@@ -401,19 +401,19 @@ The icon reports the number of items in the template file for the current file /
401401

402402
***
403403

404-
## ![Tracy Logs](icons/tracy-logs.svg)Tracy Logs
404+
## ![Tracy Logs](icons/tracy-logs.svg ':no-zoom')Tracy Logs
405405
Displays the most recent entries from the Tracy log files. These log files can be written to automatically when Tracy is in Production mode, or manually using `TD::log()` or `l()` calls. Includes direct links to view each entry in your code editor. By default it shows the last 10, but this can be changed in the config settings. A red icon indicates the last page load contained an error, exception, or critical log entry. An orange icon is for all other log types.
406406

407407
![Tracy Logs panel](img/tracy-logs.png)
408408

409409
***
410410

411-
## ![Tracy Toggler](icons/tracy-toggler.svg)Tracy Toggler
411+
## ![Tracy Toggler](icons/tracy-toggler.svg ':no-zoom')Tracy Toggler
412412
Not really a panel, but this button on the debug bar lets you toggle Tracy on / off without needing to visit the module config settings. If you don't want another button always taking up room, you can also use the "Disable Tracy" button on the Panel Selector. Another alternative is the Hide/Show toggle icon at the far right of the debug bar, although this one doesn't actually turn Tracy off, but it gets the debug out of the way.
413413

414414
***
415415

416-
## ![User Switcher](icons/user-switcher.svg)User Switcher
416+
## ![User Switcher](icons/user-switcher.svg ':no-zoom')User Switcher
417417
Allows you to instantly switch to any user in the system without knowing their password. After switching, you will still have full access to the Tracy debug bar, which can be very useful for debugging issues with other users and even guest (not logged in) visitors.
418418

419419
* You need to be a superuser to have access to the panel until a session is started, so even when Development mode is enabled, other users still won't be able to use it.
@@ -431,14 +431,14 @@ As usual, icon colors are meaningful, telling you what type of user is currently
431431

432432
***
433433

434-
## ![Users](icons/users.svg)Users
434+
## ![Users](icons/users.svg ':no-zoom')Users
435435
Lists all the users/roles with access to the Tracy Debugger bar. A green debug bar icon indicates that only superusers can access the debug bar. An orange icon indicates that others have the tracy-debugger permission and may be able to see the debug bar. Another good reason to have the "Superuser Force Development Mode" option enabled because you will see this warning even in Production mode.
436436

437437
![Users panel](img/users.png)
438438

439439
***
440440

441-
## ![Validator](icons/validator.svg)Validator
441+
## ![Validator](icons/validator.svg ':no-zoom')Validator
442442
Validates the HTML of the page using the validator.nu service. This works with local development sites as well as live sites.
443443

444444
![Validator panel](img/validator.png)

0 commit comments

Comments
 (0)