Skip to content

Custom profiler overdiv

Derek Jones edited this page Jul 5, 2012 · 11 revisions

Category:Core::Profiler

Custom profiler, similar in function to Kohana profiler, overdiv on top and hidden, activated by mouse click.

Uses jQuery.

Hope can be a base to make a better visual profiler.

Download: File:MY_Profiler.zip

Install:

Copy the file to your application/libraries directory Be sure your subclass_prefix config (in config.php), its MY_, else change the MY_Profiler.php name to your subclass_prefix name, also remember to modify class name in the MY_Profiler.php file.

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Profiler extends CI_Profiler
{
    function MY_profiler()
    {
        parent::CI_Profiler();
    }

    function run()
    {
        
// START JQueryLoad        
// Remove if you load Jquery else where 
            $output = '<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>';
// End JQueryLoad
            $i_currentDIV = rand(10,99).substr(md5($_SERVER["REQUEST_URI"]),0,6);
            $output .= "
"; $output .= " X "; $output .= "
"
; $output .= "
"; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= "
URI Controler Memory Benchmarks Variables SQL <<<
"; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= ""; $output .= "
"
; $output .= "
"
; return $output; } }

Clone this wiki locally