Posted by podarok on February 27, 2013 at 6:48pm
3 followers
| Project: | XHProf |
| Version: | 8.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
| Issue tags: | Needs tests |
Issue Summary
just finished porting to 8.x http://drupal.org/sandbox/podarok/1924526
here is a patch against latest 8.x-1.x
| Attachment | Size |
|---|---|
| xhprof8.patch | 3.73 KB |
Comments
#1
fixed comments
#2
+++ b/lib/Drupal/xhprof/EventSubscriber/XHProfSubscriber.phpundefined
@@ -0,0 +1,34 @@
+// use Symfony\Component\HttpKernel\KernelEvents;
+// use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+++ b/lib/Drupal/xhprof/XHProfBundle.phpundefined
@@ -0,0 +1,22 @@
\ No newline at end of file
Should be cleaned-up
+++ b/lib/Drupal/xhprof/EventSubscriber/XHProfSubscriber.phpundefined@@ -0,0 +1,34 @@
+ public function onKernelRequestTest() {
+ drupal_set_message(t('My event subscriber fired!'));
...
+ static function getSubscribedEvents() {
+ $events[KernelEvents::REQUEST][] = array('onKernelRequestTest', 100);
is not needed
+++ b/lib/Drupal/xhprof/XHProfSubscriber.phpundefined@@ -0,0 +1,42 @@
+ if (xhprof_xhprof_enable()) {
...
+ static function getSubscribedEvents() {
+ $events[KernelEvents::REQUEST][] = array('XHProfLoad', 999);
Suppose better make the check xhprof_xhprof_enable() in getSubscribedEvents()
+++ b/lib/Drupal/xhprof/XHProfSubscriber.phpundefined@@ -0,0 +1,42 @@
+ drupal_set_message('XHProf: subscribed');
No reason for message
#3
Attached is an updated patch with some of the latest 8.x changes. Not quite tested fully yet.
Not sure that's the right design choice. getSubscribedEvents() should just get the events, not do any business logic.
#4
#3 thanks!
looks good for me