File tree Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 7
7
$ debugbar = new StandardDebugBar ();
8
8
$ debugbarRenderer = $ debugbar ->getJavascriptRenderer ()->setBaseUrl ('../src/DebugBar/Resources ' );
9
9
10
- $ debugbar ->setStorage (new DebugBar \Storage \FileStorage (__DIR__ . '/profiles ' ));
11
- $ debugbarRenderer ->setOpenHandlerUrl ('open.php ' );
10
+ //
11
+ // create a writable profiles folder in the demo directory to uncomment the following lines
12
+ //
13
+ //$debugbar->setStorage(new DebugBar\Storage\FileStorage(__DIR__ . '/profiles'));
14
+ //$debugbarRenderer->setOpenHandlerUrl('open.php');
12
15
13
16
function render_demo_page (Closure $ callback = null )
14
17
{
Original file line number Diff line number Diff line change 1
1
# Javascript Bar
2
2
3
+ ** This section is here to document the inner workings of the client side debug bar.
4
+ Nothing described below is needed to run the debug bar in a normal way.**
5
+
3
6
The default client side implementation of the debug bar is made
4
7
entirely in Javascript and is located in the * debugbar.js* file.
5
8
@@ -165,3 +168,14 @@ and indicators of type `PhpDebugBar.DebugBar.Indicator`. These classes subclass
165
168
// ----
166
169
167
170
debugbar.addIndicator('phpdoc', new LinkIndicator({ href: 'http://doc.php.com', title: 'PHP doc' }));
171
+
172
+ ## OpenHandler
173
+
174
+ An OpenHandler object can be provided using ` setOpenHandler() ` . The object is in charge
175
+ of loading datasets. The only requirement is to provide a ` show() ` method which takes
176
+ as only parameter a callback which expects an id and data parameter.
177
+
178
+ The default implementation is ` PhpDebugBar.OpenHandler ` which must be use in conjonction
179
+ with the server side ` DebugBar\OpenHandler ` (see previous section).
180
+
181
+ debugbar.setOpenHandler(new PhpDebugBar.OpenHandler({ url: "open.php" }));
Original file line number Diff line number Diff line change 9
9
" base_collectors.md" ,
10
10
" bridge_collectors.md" ,
11
11
" storage.md" ,
12
+ " openhandler.md" ,
12
13
" javascript_bar.md"
13
14
]
14
15
}
Original file line number Diff line number Diff line change
1
+ # Open handler
2
+
3
+ The debug bar can open previous sets of collected data which were stored using
4
+ a storage handler (see previous section). To do so, it needs to be provided an
5
+ url to an open handler.
6
+
7
+ An open handler must respect a very simple protocol. The default implementation
8
+ is ` DebugBar\OpenHandler ` .
9
+
10
+ $openHandler = new DebugBar\OpenHandler($debugbar);
11
+ $openHandler->handle();
12
+
13
+ Calling ` handle() ` will use data from the ` $_REQUEST ` array and echo the output.
14
+ The function also supports input from other source if you provide an array as
15
+ first argument. It can also return the data instead of echoing (use false as
16
+ second argument) and not send the content-type header (use false as third argument).
17
+
18
+ One you have setup your open handler, tell the ` JavascriptRenderer ` its url.
19
+
20
+ $renderer->setOpenHandlerUrl('open.php');
21
+
22
+ This adds a button in the top right corner of the debug bar which allows you
23
+ to browse and open previous sets of collected data.
You can’t perform that action at this time.
0 commit comments