/** * Force database connection. * Jason: Note this is used in core initiation to fix some dependent functions like mysql_real_escape_string requiring a DB connection. * Only dbConnecter->query initiated the connection which was unfair to dependent functions. * * Don: The connector will apply the database settings itself since each connector may have different settings. For backwards * compatibility the connector will set the database properties for the main db instance as well. In the feature the db * class won't have public properties for the database settings such as $db->server, $db->dbName, etc. since each connector may * have different settings. * * @date 20120308 */ public function connect($db_config = '') { $this->connector->connect($db_config); }
/** * Force database connection. * Jason: Note this is used in core initiation to fix some dependent functions like mysql_real_escape_string requiring a DB connection. * Only dbConnecter->query initiated the connection which was unfair to dependent functions. * * Don: The connector will apply the database settings itself since each connector may have different settings. For backwards * compatibility the connector will set the database properties for the main db instance as well. In the feature the db * class won't have public properties for the database settings such as $db->server, $db->dbName, etc. since each connector may * have different settings. * * @date 20120308 */ public function connect($db_config = '') { try { $this->connector->connect($db_config); } catch (Exception $e) { throw $this->factory('PHPDS_databaseException', '', 0, $e); } }