By daffie on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.0.x
Introduced in version:
10.0.0
Issue links:
Description:
The function db_installer_object() has been deprecated and will be removed before the release of Drupal 11.0. There is no replacement for this function.
In Drupal 9 and before the installer object could be in different locations depending on the type of database driver used. In Drupal 10 and higher all database drivers are located in a module. All database drivers have the same namespace formula. Which is Drupal\{module_name}\Driver\Database\{driver_name}. Because of this change is the replacement code for the function is:
// Before
$installer = db_installer_object($driver, $namespace);
//After
$installer_class = $namespace . "\\Install\\Tasks";
$installer = new $installer_class();
Impacts:
Module developers