Welcome Guest, Not a member yet? Register   Sign In
CI 1.7.0, multi db and profiler
#1

[eluser]m_i_n[/eluser]
In CI 1.7.0 profiler should show queries in all databases connections.

I have 2 multiply connections to 2 databases, and when i run profiler, he show only the first one, such like in 1.6.3, why?

Sorry for my english Wink
#2

[eluser]GotPHP.com[/eluser]
[quote author="m_i_n" date="1224944010"]In CI 1.7.0 profiler should show queries in all databases connections.

I have 2 multiply connections to 2 databases, and when i run profiler, he show only the first one, such like in 1.6.3, why?

Sorry for my english Wink[/quote]

I just finished writing a tutorial for CI 1.6.3 to support this if you need it.

http://www.gotphp.com/php/2008/10/25/cod...e-support/

I'll be upgrading to 1.7.0 this week and checking out the new functionality as well.
#3

[eluser]m_i_n[/eluser]
OK, i solve my problem. If we want to profiler show quries from all databases we must connect to additional db in this way:

Code:
$CI =& get_instance();
$CI->forum_db = $this->load->database('mybb', true);

but, the profiler is still bugged, they dont show correct number of queries from anothers dbs.

Profiler.php

Code:
....
            $output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'&nbsp;&nbsp;&nbsp;</legend>';
....

correct version:

Code:
....
            $output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'&nbsp;&nbsp;&nbsp;</legend>';
....

I'm change $this->CI->db->queries to $db->queries
#4

[eluser]GotPHP.com[/eluser]
I accounted for this in my version, but maybe their version needs a bit more tweaking. If you want, you can try my version in 1.7 and it should do what you want.




Theme © iAndrew 2016 - Forum software by © MyBB