support mysqli in connection string (#2190)
This commit is contained in:
@@ -22,8 +22,9 @@ class DoctrineCompilerPass implements CompilerPassInterface
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
private $allowedEngines = [
|
private $allowedEngines = [
|
||||||
'mysql',
|
'mysql' => 'mysql',
|
||||||
'sqlite'
|
'mysqli' => 'mysql',
|
||||||
|
'sqlite' => 'sqlite',
|
||||||
];
|
];
|
||||||
|
|
||||||
private function getEnvVar(string $name): ?string
|
private function getEnvVar(string $name): ?string
|
||||||
@@ -72,14 +73,14 @@ class DoctrineCompilerPass implements CompilerPassInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\in_array($engine, $this->allowedEngines)) {
|
if (!\array_key_exists($engine, $this->allowedEngines)) {
|
||||||
throw new \Exception(
|
throw new \Exception(
|
||||||
'Unsupported database engine: ' . $engine . '. Kimai only supports one of: ' .
|
'Unsupported database engine: ' . $engine . '. Kimai only supports one of: ' .
|
||||||
implode(', ', $this->allowedEngines)
|
implode(', ', array_keys($this->allowedEngines))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $engine;
|
return $this->allowedEngines[$engine];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user