src/xPDO/xPDOConnection.php
public function connect($driverOptions = array()) {
        if ($this->pdo === null) {
            if (is_array($driverOptions) && !empty($driverOptions)) {
                $this->config['driverOptions']= array_merge($this->config['driverOptions'], $driverOptions);
            }
            try {
                $this->pdo= new \PDO($this->config['dsn'], $this->config['username'], $this->config['password'], $this->config['driverOptions']);
            } catch (\PDOException $xe) {
                $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $xe->getMessage(), '', __METHOD__, __FILE__, __LINE__);
                return false;
            } catch (\Exception $e) {
                $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__);
                return false;
            }

            $connected= (is_object($this->pdo));
            if ($connected) {
                $connectFile = XPDO_CORE_PATH . 'om/' . $this->config['dbtype'] . '/connect.inc.php';
                if (!empty($this->config['connect_file']) && file_exists($this->config['connect_file'])) {
                    $connectFile = $this->config['connect_file'];
                }
                if (file_exists($connectFile)) include ($connectFile);
            }
            if (!$connected) {
                $this->pdo= null;
            }
        }
        $connected= is_object($this->pdo);
        return $connected;
    }
public function connect($driverOptions = array()) {
        if ($this->pdo === null) {
            if (is_array($driverOptions) && !empty($driverOptions)) {
                $this->config['driverOptions']= array_merge($this->config['driverOptions'], $driverOptions);
            }
            try {
                $this->pdo= new \PDO($this->config['dsn'], $this->config['username'], $this->config['password'], $this->config['driverOptions']);
            } catch (\PDOException $xe) {
                $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $xe->getMessage(), '', __METHOD__, __FILE__, __LINE__);
                return false;
            } catch (\Exception $e) {
                $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__);
                return false;
            }

            $connected= (is_object($this->pdo));
            if ($connected) {
                $connectFile = XPDO_CORE_PATH . 'om/' . $this->config['dbtype'] . '/connect.inc.php';
                if (!empty($this->config['connect_file']) && file_exists($this->config['connect_file'])) {
                    $connectFile = $this->config['connect_file'];
                }
                if (file_exists($connectFile)) include ($connectFile);
            }
            if (!$connected) {
                $this->pdo= null;
            }
        }
        $connected= is_object($this->pdo);
        return $connected;
    }
public function connect ( $ driverOptions = array ( ) ) { if ( $ this -> pdo === null ) { if ( is_array ( $ driverOptions ) && ! empty ( $ driverOptions ) ) { $ this -> config [ 'driverOptions' ] = array_merge ( $ this -> config [ 'driverOptions' ] , $ driverOptions ) ; } try { $ this -> pdo = new \ PDO ( $ this -> config [ 'dsn' ] , $ this -> config [ 'username' ] , $ this -> config [ 'password' ] , $ this -> config [ 'driverOptions' ] ) ; } catch ( \ PDOException $ xe ) { $ this -> xpdo -> log ( xPDO :: LOG_LEVEL_ERROR , $ xe -> getMessage ( ) , '' , __METHOD__ , __FILE__ , __LINE__ ) ; return false ; } catch ( \ Exception $ e ) { $ this -> xpdo -> log ( xPDO :: LOG_LEVEL_ERROR , $ e -> getMessage ( ) , '' , __METHOD__ , __FILE__ , __LINE__ ) ; return false ; } $ connected = ( is_object ( $ this -> pdo ) ) ; if ( $ connected ) { $ connectFile = XPDO_CORE_PATH . 'om/' . $ this -> config [ 'dbtype' ] . '/connect.inc.php' ; if ( ! empty ( $ this -> config [ 'connect_file' ] ) && file_exists ( $ this -> config [ 'connect_file' ] ) ) { $ connectFile = $ this -> config [ 'connect_file' ] ; } if ( file_exists ( $ connectFile ) ) include ( $ connectFile ) ; } if ( ! $ connected ) { $ this -> pdo = null ; } } $ connected = is_object ( $ this -> pdo ) ; return $ connected ; }
Actually make a connection for this instance via PDO.

@param array $driverOptions An array of PDO driver options for the connection.
@return bool True if a successful connection is made.
Actually make a connection for this instance via PDO .