Skip to content

Commit a9925c7

Browse files
committed
fix: pass through custom drivers
Because we can name any classname.
1 parent 59aca8e commit a9925c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

system/Database/Database.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,15 @@ protected function initDriver(string $driver, string $class, $argument): object
146146
/**
147147
* Check the PHP database extension is loaded.
148148
*
149-
* @param string $driver DB driver
149+
* @param string $driver DB driver or FQCN for custom driver
150150
*/
151151
private function checkDbExtension(string $driver): bool
152152
{
153+
if (str_contains($driver, '\\')) {
154+
// Cannot check a fully qualified classname for a custom driver.
155+
return true;
156+
}
157+
153158
$extensionMap = [
154159
// DBDriver => PHP extension
155160
'MySQLi' => 'mysqli',

0 commit comments

Comments
 (0)