3.1.RC1
Fixed dns building for non-absolute paths
This commit is contained in:
parent
63c332a697
commit
1c674e5e67
1 changed files with 7 additions and 2 deletions
|
@ -469,8 +469,13 @@ if (!function_exists('dsnFromConfig')) {
|
|||
function dsnFromConfig(array $config): string
|
||||
{
|
||||
$dsn = $config['db']['dsn'];
|
||||
if ($config['db']['connection'] === 'sqlite' && file_exists($config['db']['dsn'])) {
|
||||
$dsn = realpath($config['db']['dsn']);
|
||||
if ($config['db']['connection'] === 'sqlite') {
|
||||
if (getcwd() !== BASE_DIR) { // if in installer, change the working dir to the app dir
|
||||
chdir(BASE_DIR);
|
||||
}
|
||||
if (file_exists($config['db']['dsn'])) {
|
||||
$dsn = realpath($config['db']['dsn']);
|
||||
}
|
||||
}
|
||||
|
||||
return $config['db']['connection'].':'.$dsn;
|
||||
|
|
Loading…
Add table
Reference in a new issue