Commit 3231fae6 authored by catch's avatar catch
Browse files

Issue #3284970 by alexpott: Reduce complexity in \Drupal\Core\Site\Settings::initialize

(cherry picked from commit 901c5e1b)
parent 829d1661
......@@ -184,23 +184,17 @@ public static function initialize($app_root, $site_path, &$class_loader) {
// arrays. Those do not have the 'autoload' key set for core database
// drivers.
if (empty($info['autoload'])) {
switch (strtolower($info['driver'])) {
case 'mysql':
if (trim($info['namespace'], '\\') === "Drupal\\mysql\\Driver\\Database\\mysql") {
$info['autoload'] = "core/modules/mysql/src/Driver/Database/mysql/";
}
switch (trim($info['namespace'], '\\')) {
case "Drupal\\mysql\\Driver\\Database\\mysql":
$info['autoload'] = "core/modules/mysql/src/Driver/Database/mysql/";
break;
case 'pgsql':
if (trim($info['namespace'], '\\') === "Drupal\\pgsql\\Driver\\Database\\pgsql") {
$info['autoload'] = "core/modules/pgsql/src/Driver/Database/pgsql/";
}
case "Drupal\\pgsql\\Driver\\Database\\pgsql":
$info['autoload'] = "core/modules/pgsql/src/Driver/Database/pgsql/";
break;
case 'sqlite':
if (trim($info['namespace'], '\\') === "Drupal\\sqlite\\Driver\\Database\\sqlite") {
$info['autoload'] = "core/modules/sqlite/src/Driver/Database/sqlite/";
}
case "Drupal\\sqlite\\Driver\\Database\\sqlite":
$info['autoload'] = "core/modules/sqlite/src/Driver/Database/sqlite/";
break;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment