All pastes #588763 Raw Edit

Someone

public text v1 · immutable
#588763 ·published 2007-06-25 17:57 UTC
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;
    }