Dsn
Data Source Name (DSN), a reference to a path on a local or remote system with the ability to add parameters.
The format for the DSN is inspired by the PDO DSN format (https://www.php.net/manual/en/ref.pdo-mysql.connection.php) where you have a string containing Semicolon Separated Values (SSV), where each part is a key=value pair. Exception to this rule is the first entry in the string; this is the URI where the referenced Data Source is located.
A simple example can be a reference to your project folder:
file:///home/mvriel/project/src
Yet a more complex example may be a reference to a specific branch on a git repository:
git+https://github.com/phpDocumentor/phpDocumentor;path=/src;branch=release/3.0
In the example above we reference a git repository using the http protocol and as options we mention that the branch
that we would like to parse is release/3.0
and in it we want to start at the path /src
.
Properties
$dsn Line 52
private$dsn : string
$uri Line 55
private$uri : \League\Uri\Contracts\UriInterface
$parameters Line 58
private$parameters : string[]
Methods
__construct() Line 65
Initializes the Dsn
public__construct(UriInterface $uri, string[] $parameters, string $dsn) : mixed
Parameters
Returns
mixed —
createFromString() Line 72
publicstaticcreateFromString(string $dsn) : self
Parameters
Returns
self —
createFromUri() Line 87
publicstaticcreateFromUri(UriInterface $uri[, string[] $parameters = [] ]) : self
Parameters
Returns
self —Returns
string —Returns
string|null —Returns
string —Returns
int|null —Returns
string —Returns
string —
isWindowsLocalPath() Line 172
publicisWindowsLocalPath() : bool
Returns
bool —Returns
string[] —Returns
string[] —
resolve() Line 202
publicresolve(Dsn $baseDsn) : self
withPath() Line 217
publicwithPath(Path $path) : self
parseParameters() Line 234
validates and sets the parameters property
privatestaticparseParameters(string[] $parameters) : array