Changeset 16


Ignore:
Timestamp:
Nov 13, 2005 5:02:33 AM (19 years ago)
Author:
scdev
Message:

slight cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DBSessionHandler.inc.php

    r15 r16  
    3434        $this->_params = array_merge($this->_params, $params);
    3535       
    36         if (isset($db) && is_a($db, 'DB') && $db->isConnected()) {
    37             // Use existing db connection.
    38             $this->db =& $db;
    39            
    40         } else if (isset($db) && is_a($db, 'DB')) {
    41             // Not a DB object.
    42             App::logMsg(sprintf('Provided DB object is not connected. %s', mysql_error($db->dbh)), LOG_ERR, __FILE__, __LINE__);
    43            
    44         } else if (isset($db)) {
    45             // Not a DB object.
    46             App::logMsg(sprintf('Provided DB object is not valid. %s', gettype($db)), LOG_ERR, __FILE__, __LINE__);
    47            
     36        if (isset($db)) {
     37            if (is_a($db, 'DB')) {
     38                if ($db->isConnected()) {
     39                    // Use existing db connection.
     40                    $this->db =& $db;
     41                } else {
     42                    App::logMsg(sprintf('Provided DB object is not connected. %s', mysql_error($db->dbh)), LOG_ERR, __FILE__, __LINE__);
     43                }
     44            } else {
     45                App::logMsg(sprintf('Provided DB object is not valid. %s', gettype($db)), LOG_ERR, __FILE__, __LINE__);
     46            }
    4847        } else {
    4948            // Create our own new db connection.
Note: See TracChangeset for help on using the changeset viewer.