Skip to content

Commit

Permalink
fix: pass through custom drivers
Browse files Browse the repository at this point in the history
Because we can name any classname.
  • Loading branch information
kenjis committed Aug 30, 2024
1 parent 59aca8e commit a9925c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ protected function initDriver(string $driver, string $class, $argument): object
/**
* Check the PHP database extension is loaded.
*
* @param string $driver DB driver
* @param string $driver DB driver or FQCN for custom driver
*/
private function checkDbExtension(string $driver): bool
{
if (str_contains($driver, '\\')) {
// Cannot check a fully qualified classname for a custom driver.
return true;
}

$extensionMap = [
// DBDriver => PHP extension
'MySQLi' => 'mysqli',
Expand Down

0 comments on commit a9925c7

Please sign in to comment.