class ConfigurationUrlParser extends ConfigurationUrlParser (View source)

Traits

Properties

static protected array<string, string> $sqlServerDsnOptionAliases

The SQL Server DSN option aliases.

from  ParsesSqlServerConfigurationUrls
static protected array<string, string> $driverAliases

The drivers aliases map.

from  ConfigurationUrlParser

Methods

bool
isSqlServerDsn(string $url)

Determine if the given value is a SQL Server DSN.

array<string, mixed>
parseSqlServerDsnConfiguration(array<string, mixed> $config, string $dsn)

Parse a SQL Server DSN into a database configuration.

array<string, mixed>
getSqlServerDsnConfigurationOptions(array<string, string> $options)

Get the database configuration options from a SQL Server DSN.

array<string, string>
parseSqlServerDsnOptions(string $dsn)

Parse the options from a SQL Server DSN.

array{0: string|null, 1: int|null}
parseSqlServerDsnServer(string|null $server)

Parse the host and port from a SQL Server DSN Server option.

array<string, mixed>
parseConfiguration(array<string, mixed>|string $config)

Parse the database configuration, hydrating options using a database configuration URL if possible.

array<string, mixed>
getPrimaryOptions(array<string, mixed> $url)

Get the primary database connection options.

string|null
getDriver(array<string, mixed> $url)

Get the database driver from the URL.

string|null
getDatabase(array<string, mixed> $url)

Get the database name from the URL.

array<string, mixed>
getQueryOptions(array<string, mixed> $url)

Get all of the additional database options from the query string.

array<string, mixed>
parseUrl(string $url)

Parse the string URL to an array of components.

mixed
parseStringsToNativeTypes(mixed $value)

Convert string casted values to their native types.

static array<string, string>
getDriverAliases()

Get all of the current drivers' aliases.

static void
addDriverAlias(string $alias, string $driver)

Add the given driver alias to the driver aliases array.

Details

protected bool isSqlServerDsn(string $url)

Determine if the given value is a SQL Server DSN.

Parameters

string $url

Return Value

bool

protected array<string, mixed> parseSqlServerDsnConfiguration(array<string, mixed> $config, string $dsn)

Parse a SQL Server DSN into a database configuration.

Parameters

array<string, mixed> $config
string $dsn

Return Value

array<string, mixed>

protected array<string, mixed> getSqlServerDsnConfigurationOptions(array<string, string> $options)

Get the database configuration options from a SQL Server DSN.

Parameters

array<string, string> $options

Return Value

array<string, mixed>

protected array<string, string> parseSqlServerDsnOptions(string $dsn)

Parse the options from a SQL Server DSN.

Parameters

string $dsn

Return Value

array<string, string>

protected array{0: string|null, 1: int|null} parseSqlServerDsnServer(string|null $server)

Parse the host and port from a SQL Server DSN Server option.

Parameters

string|null $server

Return Value

array{0: string|null, 1: int|null}

array<string, mixed> parseConfiguration(array<string, mixed>|string $config)

Parse the database configuration, hydrating options using a database configuration URL if possible.

Parameters

array<string, mixed>|string $config

Return Value

array<string, mixed>

protected array<string, mixed> getPrimaryOptions(array<string, mixed> $url)

Get the primary database connection options.

Parameters

array<string, mixed> $url

Return Value

array<string, mixed>

protected string|null getDriver(array<string, mixed> $url)

Get the database driver from the URL.

Parameters

array<string, mixed> $url

Return Value

string|null

protected string|null getDatabase(array<string, mixed> $url)

Get the database name from the URL.

Parameters

array<string, mixed> $url

Return Value

string|null

protected array<string, mixed> getQueryOptions(array<string, mixed> $url)

Get all of the additional database options from the query string.

Parameters

array<string, mixed> $url

Return Value

array<string, mixed>

protected array<string, mixed> parseUrl(string $url)

Parse the string URL to an array of components.

Parameters

string $url

Return Value

array<string, mixed>

Exceptions

InvalidArgumentException

protected mixed parseStringsToNativeTypes(mixed $value)

Convert string casted values to their native types.

Parameters

mixed $value

Return Value

mixed

static array<string, string> getDriverAliases()

Get all of the current drivers' aliases.

Return Value

array<string, string>

static void addDriverAlias(string $alias, string $driver)

Add the given driver alias to the driver aliases array.

Parameters

string $alias
string $driver

Return Value

void