Changeset 3612


Ignore:
Timestamp:
Jul 16, 2009, 9:26:57 PM (12 years ago)
Author:
rvelices
Message:

merge r3611 from trunk
improve event tracer: add the possibility to dump all the included php files

Location:
branches/2.0/plugins/event_tracer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/plugins/event_tracer/main.inc.php

    r3274 r3612  
    2424/*
    2525Plugin Name: Event tracer
    26 Version: 2.0.2
     26Version: 2.0.3
    2727Description: For developers. Shows all calls to trigger_event.
    2828Plugin URI: http://piwigo.org/ext/extension_view.php?eid=288
     
    6666    {
    6767      $this->my_config['filters'] = array( '.*' );
    68       $this->my_config['show_args'] = false;
    6968      $this->my_config['show_registered'] = true;
    7069      $this->save_config();
     
    8382  function on_page_tail()
    8483  {
    85     if (1 || @$this->my_config['show_registered'])
     84    global $debug;
     85    if (@$this->my_config['show_registered'])
    8686    {
    87       global $debug, $pwg_event_handlers;
     87      global $pwg_event_handlers;
    8888      $out = '';
    8989      foreach ($pwg_event_handlers as $event => $prio_array)
     
    112112      $debug .= '<pre>'.$out.'</pre>';
    113113    }
     114    if (@$this->my_config['show_included_files'])
     115    {
     116      $debug .= "<pre><em>Included files</em>\n".var_export( get_included_files(), true ).'</pre>';
     117    }
    114118  }
    115119
     
    123127      if ( preg_match( '/'.$filter.'/', $event_info['event'] ) )
    124128      {
    125         if ($this->my_config['show_args'])
     129        if (@$this->my_config['show_args'])
    126130        {
    127131          $s = '<pre>';
  • branches/2.0/plugins/event_tracer/tracer_admin.php

    r2771 r3612  
    1919  $me->my_config['show_args'] = isset($_POST['eventTracer_show_args']);
    2020  $me->my_config['show_registered'] = isset($_POST['eventTracer_show_registered']);
     21  if (isset($_POST['eventTracer_show_included_files']) )
     22    $me->my_config['show_included_files'] = true;
     23  else
     24    unset($me->my_config['show_included_files']);
    2125  $me->save_config();
    2226  global $page;
     
    2428}
    2529$template->assign('EVENT_TRACER_FILTERS', implode("\n", $me->my_config['filters'] ) );
    26 $template->assign('EVENT_TRACER_SHOW_ARGS', $me->my_config['show_args'] ? 'checked="checked"' : '' );
     30$template->assign('EVENT_TRACER_SHOW_ARGS', @$me->my_config['show_args'] ? 'checked="checked"' : '' );
    2731$template->assign('U_LIST_EVENTS', get_admin_plugin_menu_link(dirname(__FILE__).'/event_list.php'));
    28 $template->assign('EVENT_TRACER_SHOW_REGISTERED', $me->my_config['show_registered'] ? 'checked="checked"' : '' );
     32$template->assign('EVENT_TRACER_SHOW_REGISTERED', @$me->my_config['show_registered'] ? 'checked="checked"' : '' );
     33$template->assign('EVENT_TRACER_SHOW_INCLUDED_FILES', @$me->my_config['show_included_files'] ? 'checked="checked"' : '' );
    2934
    3035//$template->assign_var('EVENT_TRACER_F_ACTION', $my_url);
  • branches/2.0/plugins/event_tracer/tracer_admin.tpl

    r2771 r3612  
    3030</label>
    3131
     32<label>Show all included php files
     33        <input type="checkbox" name="eventTracer_show_included_files" {$EVENT_TRACER_SHOW_INCLUDED_FILES} />
     34</label>
     35
    3236</fieldset>
    3337
Note: See TracChangeset for help on using the changeset viewer.