diff --git a/core/lib/Drupal/Core/Database/DatabaseDriverDiscovery.php b/core/lib/Drupal/Core/Database/DatabaseDriverDiscovery.php index 42b199e..2c81f13 100644 --- a/core/lib/Drupal/Core/Database/DatabaseDriverDiscovery.php +++ b/core/lib/Drupal/Core/Database/DatabaseDriverDiscovery.php @@ -110,13 +110,16 @@ public function discoverDatabaseDrivers() { $files = []; foreach ($this->discoveryLocations as $namespace => $location) { if (is_dir($this->drupalRoot . $location)) { - $dirFiles = file_scan_directory($this->drupalRoot . $location, $mask, ['recurse' => FALSE]); - foreach ($dirFiles as $file) { - $driverName = $file->filename; - if (isset($files[$driverName])) { - throw new \Exception("Conflicting database driver name: " . $driverName); + if ($handle = @opendir($this->drupalRoot . $location)) { + while (FALSE !== ($driverName = readdir($handle))) { + // Skip this file if it matches the nomask or starts with a dot. + if ($driverName[0] != '.') { + if (isset($files[$driverName])) { + throw new \Exception("Conflicting database driver name: " . $driverName); + } + $files[$driverName] = $namespace . '\\' . $driverName; + } } - $files[$driverName] = $namespace . '\\' . $driverName; } } }