Merge pull request #9361 from kinglozzer/configure-database-glob

Minor performance improvement in DatabaseAdapterRegistry::autoconfigure()
This commit is contained in:
Robbie Averill 2020-01-14 09:25:07 -08:00 committed by GitHub
commit bdc723ff69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,12 +145,8 @@ class DatabaseAdapterRegistry
$databaseConfig = $config;
}
// Search through all composer packages in vendor, updating $databaseConfig
foreach (glob(BASE_PATH . '/vendor/*', GLOB_ONLYDIR) as $vendor) {
foreach (glob($vendor . '/*', GLOB_ONLYDIR) as $directory) {
if (file_exists($directory . '/_configure_database.php')) {
include_once($directory . '/_configure_database.php');
}
}
foreach (glob(BASE_PATH . '/vendor/*/*/_configure_database.php') as $configFile) {
include_once $configFile;
}
// Update modified variable
$config = $databaseConfig;