Welcome Guest, Not a member yet? Register   Sign In
2 databases and libraries
#9

[eluser]WanWizard[/eluser]
I had to modify the _compile_queries method of the profiler library to have multiple DB detection work properly. I replaced
Code:
// Let's determine which databases are currently connected to
foreach (get_object_vars($this->CI) as $CI_object)
{
    if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB') )
    {
        $dbs[] = $CI_object;
    }
}
By
Code:
// Let's determine which databases we are currently connected to
foreach (get_object_vars($this->CI) as $CI_object)
{
    if ( strtolower(get_parent_class($CI_object)) == 'ci_db' )
    {
        $dbs[] = $CI_object;
    }
}

And indeed, the profiler can't access the query statistics if you create the database object locally, the way the manual says it:
Code:
$DB1 = $this->load->database('group_one', TRUE);

But it does if you do
Code:
$this->DB1 = $this->load->database('group_one', TRUE);

You can only access the 'groupname' in the profiler if you modify the CI core file DB.php, since that is where parsing of the parameter takes place (can be anything, from empty to a string to an array)...


Messages In This Thread
2 databases and libraries - by El Forum - 01-14-2010, 08:21 AM
2 databases and libraries - by El Forum - 01-14-2010, 10:54 AM
2 databases and libraries - by El Forum - 01-15-2010, 01:36 AM
2 databases and libraries - by El Forum - 01-15-2010, 01:52 AM
2 databases and libraries - by El Forum - 01-15-2010, 02:12 AM
2 databases and libraries - by El Forum - 02-02-2010, 02:44 AM
2 databases and libraries - by El Forum - 04-26-2010, 04:30 AM
2 databases and libraries - by El Forum - 06-29-2010, 04:24 PM
2 databases and libraries - by El Forum - 06-30-2010, 12:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB