Database connection in class.global.inc.php
Posted: Fri Jun 02, 2006 1:08 pm
I originally came here to report a bug in the latest release, but after checking SVN I found it was fixed. Good work!
However, I can't say the fix looks too good.
In cmsObject::getDb(), there is (naturally) a check to see if the connection to the database failed.
It reads
The condition accesses a private variable. I suggest you instead keep the return value from $dbinstance->Connect(), and check that. Alternatively, use the $dbinstance->IsConnected() method.
However, I can't say the fix looks too good.
In cmsObject::getDb(), there is (naturally) a check to see if the connection to the database failed.
It reads
Code: Select all
if (!$dbinstance || (TRUE == empty($dbinstance->_connectionID) && TRUE == empty($dbinstance->connectionId)))
{
var_dump($dbinstance);
die("Database Connection failed");
}