rendered paste body function dsn_connect($dsn)
{
// Use persistent connections if available
$dbh = DB::connect($dsn, array('persistent' => $this->db_pconn));
if (DB::isError($dbh))
{
$this->db_error = TRUE;
$this->db_error_msg = $dbh->getMessage();
raise_error(array('code' => 603, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
'message' => $this->db_error_msg), TRUE, FALSE);
return FALSE;
}
else if ($this->db_provider=='sqlite')
{
$dsn_array = DB::parseDSN($dsn);
if (!filesize($dsn_array['database']) && !empty($this->sqlite_initials))
$this->_sqlite_create_database($dbh, $this->sqlite_initials);
}
return $dbh;
}