Welcome Guest, Not a member yet? Register   Sign In
[solved] CI2 MY_Profiler
#1

[eluser]kaejiavo[/eluser]
Hi guys,
i have a problem using my profiler extension in ci2.
MY_Profiler (ci1.7.2) looks like
Code:
class MY_Profiler extends CI_Profiler {

    /**
     * Adds doctrine SQL data to the profiler
     * Doctrine_Connection_Profiler start see
     * hooks/doctrine_profiler_hooks.php
     */
    public function _compile_doctrine() {

    $output = ...
    return $output;
    }

    /**
     * Adds session data to the profiler
     * Adds a table row for each item of session data with the key and value
     * Shows both CI session data and custom session data
     */
    function _compile_session() {
    $output = ...
    return $output;
    }

    function run() {
    $output = "<div id='codeigniter_profiler' style='clear:both;background-color:#fff;padding:10px;'>";

    $output .= $this->_compile_uri_string();
    $output .= $this->_compile_controller_info();
    $output .= $this->_compile_memory_usage();
    $output .= $this->_compile_benchmarks();
    $output .= $this->_compile_get();
    $output .= $this->_compile_post();
    $output .= $this->_compile_queries();
    $output .= $this->_compile_doctrine();
    $output .= $this->_compile_session();

    $output .= '</div>';

    return $output;
    }

This is not working with ci2 anymore and i can't find any description how to do it correct.
Can anyone help me out on this problem?

TIA
Marco
#2

[eluser]n0xie[/eluser]
Take a look at my Session Profiler Extension for CI2.0. It should answer most of your questions.
#3

[eluser]kaejiavo[/eluser]
hi n0xie,

i tried it, but nothing happens. No session section in the profiler output, only the default profiler sections.

I have the MY_Profiler.php in application/core but it seems it is not called.
For test reasons i changed:
Code:
function MY_Profiler($config = array())
    {
//am i called ??        
echo "my_profiler";
        $this->_available_sections[] = 'session';
        parent::CI_Profiler($config);
    }
but no output.

Marco
#4

[eluser]kaejiavo[/eluser]
ahh, i have found the error.
The file has to be in application/libraries to work. This seems a bit irregular to me as you have to know, which classes of ci are core and which are library to extend them correct.

Thanks for your help n0xie, you brought me on track to fix this.

Marco




Theme © iAndrew 2016 - Forum software by © MyBB