public static function createFromDSN($dsn)
    {
        if (is_string($dsn)) {
            $parsed = self::parseDSN($dsn);
        } else {
            $parsed = $dsn;
        }

        $connection = DriverManager::getConnection($parsed);

        if ($parsed['driver'] === 'pdo_sqlite') {
            return new ConnectionHandler\SqliteConnectionHandler($connection);
        }

        if ($parsed['driver'] === 'pdo_pgsql') {
            return new ConnectionHandler\PostgresConnectionHandler($connection);
        }

        return new self($connection);
    }
public static function createFromDSN($dsn)
    {
        if (is_string($dsn)) {
            $parsed = self::parseDSN($dsn);
        } else {
            $parsed = $dsn;
        }

        $connection = DriverManager::getConnection($parsed);

        if ($parsed['driver'] === 'pdo_sqlite') {
            return new ConnectionHandler\SqliteConnectionHandler($connection);
        }

        if ($parsed['driver'] === 'pdo_pgsql') {
            return new ConnectionHandler\PostgresConnectionHandler($connection);
        }

        return new self($connection);
    }
public static function createFromDSN ( $ dsn ) { if ( is_string ( $ dsn ) ) { $ parsed = self :: parseDSN ( $ dsn ) ; } else { $ parsed = $ dsn ; } $ connection = DriverManager :: getConnection ( $ parsed ) ; if ( $ parsed [ 'driver' ] === 'pdo_sqlite' ) { return new ConnectionHandler \ SqliteConnectionHandler ( $ connection ) ; } if ( $ parsed [ 'driver' ] === 'pdo_pgsql' ) { return new ConnectionHandler \ PostgresConnectionHandler ( $ connection ) ; } return new self ( $ connection ) ; }
Create a Connection Handler with corresponding Doctrine connection from DSN.

@param string|array $dsn

@return ConnectionHandler
Create a Connection Handler with corresponding Doctrine connection from DSN .