class ConfigurationUrlParser extends ConfigurationUrlParser (View source)

Properties

static protected array $driverAliases

The drivers aliases map.

from  ConfigurationUrlParser

Methods

array
parseConfiguration(array|string $config)

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

array
getPrimaryOptions(array $url)

Get the primary database connection options.

string|null
getDriver(array $url)

Get the database driver from the URL.

string|null
getDatabase(array $url)

Get the database name from the URL.

array
getQueryOptions(array $url)

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

array
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
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

array parseConfiguration(array|string $config)

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

Parameters

array|string $config

Return Value

array

protected array getPrimaryOptions(array $url)

Get the primary database connection options.

Parameters

array $url

Return Value

array

protected string|null getDriver(array $url)

Get the database driver from the URL.

Parameters

array $url

Return Value

string|null

protected string|null getDatabase(array $url)

Get the database name from the URL.

Parameters

array $url

Return Value

string|null

protected array getQueryOptions(array $url)

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

Parameters

array $url

Return Value

array

protected array parseUrl(string $url)

Parse the string URL to an array of components.

Parameters

string $url

Return Value

array

Exceptions

InvalidArgumentException

protected mixed parseStringsToNativeTypes(mixed $value)

Convert string casted values to their native types.

Parameters

mixed $value

Return Value

mixed

static array getDriverAliases()

Get all of the current drivers aliases.

Return Value

array

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