Documentation

DsnParser
in package

FinalYes
Tags
psalm-import-type

Params from DriverManager

Table of Contents

Properties

$schemeMapping  : array<string, string>

Methods

__construct()  : mixed
parse()  : array<string|int, mixed>
normalizeDatabaseUrlPath()  : string
Normalizes the given connection URL path.
parseDatabaseUrlPath()  : array<string|int, mixed>
Parses the given connection URL and resolves the given connection parameters.
parseDatabaseUrlQuery()  : array<string|int, mixed>
Parses the query part of the given connection URL and resolves the given connection parameters.
parseDatabaseUrlScheme()  : string
Parses the scheme part from given connection URL and resolves the given connection parameters.
parseRegularDatabaseUrlPath()  : array<string|int, mixed>
Parses the given regular connection URL and resolves the given connection parameters.
parseSqliteDatabaseUrlPath()  : array<string|int, mixed>
Parses the given SQLite connection URL and resolves the given connection parameters.

Properties

$schemeMapping

private array<string, string> $schemeMapping

Methods

__construct()

public __construct([array<string, string> $schemeMapping = [] ]) : mixed
Parameters
$schemeMapping : array<string, string> = []

An array used to map DSN schemes to DBAL drivers

parse()

public parse(string $dsn) : array<string|int, mixed>
Parameters
$dsn : string
Tags
psalm-return

Params

throws
MalformedDsnException
Return values
array<string|int, mixed>

normalizeDatabaseUrlPath()

Normalizes the given connection URL path.

private normalizeDatabaseUrlPath(string $urlPath) : string
Parameters
$urlPath : string
Return values
string

The normalized connection URL path

parseDatabaseUrlPath()

Parses the given connection URL and resolves the given connection parameters.

private parseDatabaseUrlPath(array<string|int, mixed> $url, array<string|int, mixed> $params) : array<string|int, mixed>

Assumes that the connection URL scheme is already parsed and resolved into the given connection parameters via parseDatabaseUrlScheme.

Parameters
$url : array<string|int, mixed>

The URL parts to evaluate.

$params : array<string|int, mixed>

The connection parameters to resolve.

Tags
see
parseDatabaseUrlScheme
Return values
array<string|int, mixed>

The resolved connection parameters.

parseDatabaseUrlQuery()

Parses the query part of the given connection URL and resolves the given connection parameters.

private parseDatabaseUrlQuery(array<string|int, mixed> $url, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$url : array<string|int, mixed>

The connection URL parts to evaluate.

$params : array<string|int, mixed>

The connection parameters to resolve.

Return values
array<string|int, mixed>

The resolved connection parameters.

parseDatabaseUrlScheme()

Parses the scheme part from given connection URL and resolves the given connection parameters.

private parseDatabaseUrlScheme(string $scheme) : string
Parameters
$scheme : string
Return values
string

The resolved driver.

parseRegularDatabaseUrlPath()

Parses the given regular connection URL and resolves the given connection parameters.

private parseRegularDatabaseUrlPath(array<string|int, mixed> $url, array<string|int, mixed> $params) : array<string|int, mixed>

Assumes that the "path" URL part is already normalized via normalizeDatabaseUrlPath.

Parameters
$url : array<string|int, mixed>

The regular connection URL parts to evaluate.

$params : array<string|int, mixed>

The connection parameters to resolve.

Tags
see
normalizeDatabaseUrlPath
Return values
array<string|int, mixed>

The resolved connection parameters.

parseSqliteDatabaseUrlPath()

Parses the given SQLite connection URL and resolves the given connection parameters.

private parseSqliteDatabaseUrlPath(array<string|int, mixed> $url, array<string|int, mixed> $params) : array<string|int, mixed>

Assumes that the "path" URL part is already normalized via normalizeDatabaseUrlPath.

Parameters
$url : array<string|int, mixed>

The SQLite connection URL parts to evaluate.

$params : array<string|int, mixed>

The connection parameters to resolve.

Tags
see
normalizeDatabaseUrlPath
Return values
array<string|int, mixed>

The resolved connection parameters.


        
On this page

Search results