ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Debug Toolbar

November 10, 2009 10:45pm

Subscribe [9]
  • #1 / Nov 10, 2009 10:45pm

    Kon Wilms

    5 posts

    I have made some changes and improvements to the 0.1 Debug Toolbar and packaged it into a 0.2 ‘release’.

    Tested on 1.7.2 and has a number of additions/changes. Ofcourse this is for debug only and will impede the performance of your site—hence I have also added the optional flag debug_key to call the toolbar on demand.

    Enjoy.

    CI Debug Toolbar
    Version 0.2

    This is a modified version of the original debug toolbar for CI ported from Kohana

    Copyright

    - based on Kohana Debug Toolbar by Aaron Forsander (http://pifantastic.com/kohana-debug-toolbar/)
    - 0.1 ported to CodeIgniter by quark (.(JavaScript must be enabled to view this email address))
    - 0.2 additions by Kon Wilms (.(JavaScript must be enabled to view this email address))

    Installation

    - copy assets folder to webroot
    - copy all other content to respective application subdirectories
    - enable hooks in application config
    - add the following to config/hooks config:

    $hook['display_override'] = array(
        'class' => 'debug_toolbar',
        'function' => 'render',
        'filename' => 'debug_toolbar.php',
        'filepath' => 'hooks'
      );

    - configure the config/debug_toolbar config

    Additions/Changes

    - config files are generically parsed for all contents
    - matchbox config files are supported and are listed as modules:/name/config
    - menu graphic changed
    - some js/css modifications taken from the kohana debug_toolbar (alignment)
    - added ability to list files called
    - debug bar can be enabled if hidden with a debug_key passed as a $_GET parameter
    - changed all names to debug_toolbar to simplify maintenance
    - assets moved and categorized

    Debug_key Functionality

    - edit the debug_toolbar config, set render to FALSE, set a key, and modify the following):
    - edit the application config

    $config['uri_protocol'] = "PATH_INFO";
    ...
    $config['enable_query_strings'] = TRUE;

    Fin.

    Edit: Attached a preview image of 0.2.

  • #2 / Nov 10, 2009 11:18pm

    Shanto

    12 posts

    Its help a lot to develop application. Thanks you and thanks to original developer.

  • #3 / Nov 10, 2009 11:34pm

    trice22

    55 posts

    That sure looks interesting. Thanks a lot!

  • #4 / Nov 11, 2009 9:10am

    eoinmcg

    311 posts

    hey konfoo!

    this looks great. many thanks for sharing.

  • #5 / Nov 11, 2009 5:50pm

    Dewos

    58 posts

    Nice! Thanks.

  • #6 / Oct 28, 2010 4:18pm

    CIfan

    11 posts

    Thx!

    In Codeigniter 2.0 I get this message when the ‘benchmarks’ panel is enabled, could you help?

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined property: CI_Benchmark::$checkpoints
    
    Filename: hooks/debug_toolbar.php
    
    Line Number: 121
  • #7 / Oct 29, 2010 2:21pm

    michalsn

    77 posts

    Move “MY_Benchmark.php” file from “application/libraries” to “application/core”. It should work.

  • #8 / Oct 29, 2010 3:15pm

    Bas Vermeulen

    99 posts

    Awesome tool michalsn!

    I can confirm that moving MY_Benchmark.php to the /application/core folder works 😊

    Cheers m8!

  • #9 / Nov 01, 2010 6:58am

    CIfan

    11 posts

    Move “MY_Benchmark.php” file from “application/libraries” to “application/core”. It should work.

    Thx, used it in my first CI2 install… 😊

  • #10 / Dec 07, 2010 6:00pm

    bjora857

    10 posts

    Move “MY_Benchmark.php” file from “application/libraries” to “application/core”. It should work.

    Should I do the same when using it with 1.72?

    I get the same error, and I cant find a core directory in application folder

  • #11 / Dec 07, 2010 6:32pm

    TaylorOtwell

    43 posts

    That looks cool! Thanks for sharing.

  • #12 / Dec 08, 2010 12:39pm

    michalsn

    77 posts

    Move “MY_Benchmark.php” file from “application/libraries” to “application/core”. It should work.

    Should I do the same when using it with 1.72?

    No, only if you use CI 2.0-dev

    For CI 1.7.2/3 it should work out of the box. Make sure that you follow the instructions from first post. I tested it couple of minutes ago and it working without a problems.

  • #13 / Dec 19, 2010 12:58pm

    Natar

    1 posts

    Thanks for sharing mate, It’s nice

  • #14 / Jan 10, 2011 5:57am

    katimaboy

    5 posts

    Did someone try to make it work as a module using HMVC Module Separation and CI 2.0 ? This is what I’m using and even tho I don’t get any error message, nothing appears :(

  • #15 / Feb 11, 2011 7:57am

    matt2012

    37 posts

    In 2.0

    I’m getting

    Severity: Notice
    
    Message: Undefined property: CI_Log::$logs
    
    Filename: hooks/debug_toolbar.php
    
    Line Number: 93

    Which is where it calls $LOG->logs;

    public function logs()
        {
            $LOG =& load_class('Log');
            return $LOG->logs;
        }

    In MY_Log I have

    class MY_Log extends CI_Log {
        
        var $logs = array();
    
        function __construct()
        {     
            parent::__construct();
            
        }
        
        function write_log($level = 'error', $msg, $php_error = FALSE){
            parent::write_log($level, $msg, $php_error);
            
            //$memory     = (!function_exists('memory_get_usage')) ? '0' : memory_get_usage();
            $b = load_class('Benchmark');
            $b->mark($msg);
            $this->logs[] = array(date('Y-m-d H:i:s P'), $level, $msg);
        }
        
    }

    Anyone see what I’m doing wrong?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases