Part of the EllisLab Network

Bug Report

Multiple DB Connection conflicts Profiler class

Date: 08/01/2008 Severity: Minor
Status: Resolved Reporter: mitchkhenly
Version: 1.6.3
Keywords: Libraries, Database Class, Pagination Class

Description

Multiple DB connection w/ enabled Profiler class returns an error.

Code Sample

$this->output->enable_profiler(true);
$this->CMSGenDB = $this->load->database('default', true);

Expected Result

no error message return

Actual Result

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Project::$db

Filename: libraries/Profiler.php

Line Number: 118
A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Profiler.php

Line Number: 118
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Project::$db

Filename: libraries/Profiler.php

Line Number: 122
A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Profiler.php

Line Number: 122

Comment on Bug Report

Page 1 of 1 pages
Posted by: dmorin on 2 August 2008 7:15pm
no avatar

I’m in a similar situation where I have the default auto-load db used only for reads (off of slaves) and I load another instance only for writes (off of a master).  In this situation, the profiler only reports on queries that use the default auto-loaded class.

Posted by: sherbo on 21 August 2008 2:02pm
no avatar

This is very similar to issue 5064.   

I wrote the beginnings of a fix for this issue in this thread ...

http://codeigniter.com/forums/viewthread/49049/

I iterate through Profiler’s CI object and find all object of class type ‘CI_DB’.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?