roundcubemail/program/lib/Roundcube/rcube_db.php
protected function dsn_connect($dsn, $mode)
    {
        $this->db_error     = false;
        $this->db_error_msg = null;

        // return existing handle
        if ($this->dbhs[$mode]) {
            $this->dbh = $this->dbhs[$mode];
            $this->db_mode = $mode;
            return $this->dbh;
        }

        // connect to database
        if ($dbh = $this->conn_create($dsn)) {
            $this->dbh          = $dbh;
            $this->dbhs[$mode]  = $dbh;
            $this->db_mode      = $mode;
            $this->db_connected = true;
        }
    }
protected function dsn_connect($dsn, $mode)
    {
        $this->db_error     = false;
        $this->db_error_msg = null;

        // return existing handle
        if ($this->dbhs[$mode]) {
            $this->dbh = $this->dbhs[$mode];
            $this->db_mode = $mode;
            return $this->dbh;
        }

        // connect to database
        if ($dbh = $this->conn_create($dsn)) {
            $this->dbh          = $dbh;
            $this->dbhs[$mode]  = $dbh;
            $this->db_mode      = $mode;
            $this->db_connected = true;
        }
    }
protected function dsn_connect ( $ dsn , $ mode ) { $ this -> db_error = false ; $ this -> db_error_msg = null ; // return existing handle if ( $ this -> dbhs [ $ mode ] ) { $ this -> dbh = $ this -> dbhs [ $ mode ] ; $ this -> db_mode = $ mode ; return $ this -> dbh ; } // connect to database if ( $ dbh = $ this -> conn_create ( $ dsn ) ) { $ this -> dbh = $ dbh ; $ this -> dbhs [ $ mode ] = $ dbh ; $ this -> db_mode = $ mode ; $ this -> db_connected = true ; } }
Connect to specific database

@param array  $dsn  DSN for DB connections
@param string $mode Connection mode (r|w)
Connect to specific database