File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Xhgui \Profiler \Profiler ;
4+
5+ function register_xhgui_plugin (Zend_Controller_Front $ controller )
6+ {
7+ $ config = new Zend_Config (array (
8+ /**
9+ * Determine whether the profiler should run.
10+ * This default implementation just disables the profiler.
11+ * Override this with your custom logic in your config
12+ * @return bool
13+ */
14+ 'profiler.enable ' => function () {
15+ return true ;
16+ },
17+
18+ // Saver to use.
19+ // Please note that 'pdo' and 'mongo' savers are deprecated
20+ // Prefer 'upload' or 'file' saver.
21+ 'save.handler ' => Profiler::SAVER_UPLOAD ,
22+
23+ // Saving profile data by upload is only recommended with HTTPS
24+ // endpoints that have IP whitelists applied.
25+ // https://github.com/perftools/php-profiler#upload-saver
26+ 'save.handler.upload ' => array (
27+ 'url ' => 'https://example.com/run/import ' ,
28+ // The timeout option is in seconds and defaults to 3 if unspecified.
29+ 'timeout ' => 3 ,
30+ // the token must match 'upload.token' config in XHGui
31+ 'token ' => 'token ' ,
32+ ),
33+ ));
34+
35+ $ controller ->registerPlugin (new XhguiProfilerPlugin ($ config ), 150 );
36+ }
You can’t perform that action at this time.
0 commit comments