Problem/Motivation
Database drivers that extend another database driver have to add the line with something like: include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Connection.php';
. When this line is not added, the database driver will fail the installation proces. The extending database driver is then using a class that is not autoloaded and therefor does not exist.
The include_once only works when the module with the extending database driver is in the same level in the directory structure. This is not very practical for sitebuilders. It is also not to the standard Drupal Core would like its code to be.
Example database drivers that extend another database driver are: https://www.drupal.org/project/mysql56 and https://www.drupal.org/project/pgsql_fallback.
Proposed resolution
Improve the autoloading for the parent database driver during installation.
Remaining tasks
TBD
User interface changes
None
API changes
The method Drupal\Core\Database\Database::findDriverAutoloadDirectory()
has been deprecated are will be removed in Drupal 11. The method has been replaced by Drupal\Core\Database\Database::getDriverAutoloading()
.
The method Drupal\Core\Database\Database::determineDriversAutoloading()
has been added and it returns autoload data for all available database drivers.
Data model changes
None
Release notes snippet
TBD