diff options
author | rvelices <rv-github@modusoptimus.com> | 2009-02-13 13:02:20 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2009-02-13 13:02:20 +0000 |
commit | b77b4f0aba107444ad5003d4c6e9b72cb348a6ca (patch) | |
tree | 02ffed73dbc2c052da0df1e8f9f69efa119a7f44 /plugins/event_tracer | |
parent | bd8b4f51bb68178ea48db2cd55b1ea3a15c63c45 (diff) |
merge r3136 from trunk
- moved check upgrade feed code to admin/include/functions_upgrade.php
- refactored some code (shorter and somehow faster - but nothing revolutionary)
- decrease lost space in permalinks.tpl and hard coded column width (was illisible)
git-svn-id: http://piwigo.org/svn/branches/2.0@3137 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/event_tracer')
-rw-r--r-- | plugins/event_tracer/main.inc.php | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/plugins/event_tracer/main.inc.php b/plugins/event_tracer/main.inc.php index 05058ac07..af45bfd6c 100644 --- a/plugins/event_tracer/main.inc.php +++ b/plugins/event_tracer/main.inc.php @@ -80,22 +80,6 @@ class EventTracer fclose( $file ); } - function on_pre_trigger_event($event_info) - { - @$this->trigger_counts[$event_info['event']]++; - $this->dump('pre_trigger_event', $event_info); - } - function on_post_trigger_event($event_info) - { - $this->dump('post_trigger_event', $event_info); - } - - function on_trigger_action($event_info) - { - @$this->trigger_counts[$event_info['event']]++; - $this->dump('trigger_action', $event_info); - } - function on_page_tail() { if (1 || @$this->my_config['show_registered']) @@ -129,8 +113,11 @@ class EventTracer } } - function dump($event, $event_info) + function on_trigger($event_info) { + if ($event_info['type']!='post_event') + @$this->trigger_counts[$event_info['event']]++; + foreach( $this->my_config['filters'] as $filter) { if ( preg_match( '/'.$filter.'/', $event_info['event'] ) ) @@ -143,7 +130,7 @@ class EventTracer } else $s = ''; - pwg_debug($event.' "'.$event_info['event'].'" '.($this->trigger_counts[$event_info['event']]).' calls '.($s) ); + pwg_debug($event_info['type'].' "'.$event_info['event'].'" '.($this->trigger_counts[$event_info['event']]).' calls '.($s) ); break; } } @@ -165,9 +152,7 @@ $obj = new EventTracer(); $obj->load_config(); add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') ); -add_event_handler('pre_trigger_event', array(&$obj, 'on_pre_trigger_event') ); -add_event_handler('post_trigger_event', array(&$obj, 'on_post_trigger_event') ); add_event_handler('loc_begin_page_tail', array(&$obj, 'on_page_tail') ); -add_event_handler('trigger_action', array(&$obj, 'on_trigger_action') ); +add_event_handler('trigger', array(&$obj, 'on_trigger') ); set_plugin_data($plugin['id'], $obj); ?> |