diff --git a/core/core.services.yml b/core/core.services.yml index b964f6cd96..1193e26aee 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -532,6 +532,7 @@ services: schema_installer: class: Drupal\Core\Extension\SchemaInstaller arguments: ['@module_handler', '@cache.default', '@keyvalue', '@database', '@cache_tags.invalidator'] + lazy: true # @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Use the other # entity* services instead. entity.manager: diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index 7ccc94f07a..ab58fa078c 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -10,7 +10,6 @@ use Drupal\Core\Extension\SchemaInstallerInterface; use Drupal\Core\Serialization\Yaml; - /** * Default implementation of the module installer. * diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index 212f22a9f8..7b7f19af64 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -104,8 +104,8 @@ class DbUpdateController extends ControllerBase { * The bare HTML page renderer. * @param \Drupal\Core\Update\UpdateRegistry $post_update_registry * The post update registry. - * @param \Drupal\Core\Extension\SchemaInstallerInterface $schema - * The schema service. + * @param \Drupal\Core\Extension\SchemaInstallerInterface $schema_installer + * The schema installer. */ public function __construct($root, KeyValueExpirableFactoryInterface $key_value_expirable_factory, CacheBackendInterface $cache, StateInterface $state, ModuleHandlerInterface $module_handler, AccountInterface $account, BareHtmlPageRendererInterface $bare_html_page_renderer, UpdateRegistry $post_update_registry, SchemaInstallerInterface $schema_installer) { $this->root = $root; diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php index e00f7d1f0e..23179eb8fe 100644 --- a/core/modules/system/src/Form/ModulesUninstallForm.php +++ b/core/modules/system/src/Form/ModulesUninstallForm.php @@ -7,7 +7,7 @@ use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; -use Drupal\Core\Schema\SchemaDataInterface; +use Drupal\Core\Extension\SchemaInstallerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -41,9 +41,9 @@ class ModulesUninstallForm extends FormBase { /** * The schema service. * - * @var \Drupal\Core\Schema\SchemaDataInterface + * @var \Drupal\Core\Extension\SchemaInstallerInterface */ - protected $schema; + protected $schemaInstaller; /** * {@inheritdoc} @@ -66,14 +66,14 @@ public static function create(ContainerInterface $container) { * The module installer. * @param \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $key_value_expirable * The key value expirable factory. - * @param \Drupal\Core\Schema\SchemaDataInterface $schema - * The schema service. + * @param \Drupal\Core\Extension\SchemaInstallerInterface $schema_installer + * The schema installer. */ - public function __construct(ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, KeyValueStoreExpirableInterface $key_value_expirable, SchemaDataInterface $schema) { + public function __construct(ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, KeyValueStoreExpirableInterface $key_value_expirable, SchemaInstallerInterface $schema_installer) { $this->moduleHandler = $module_handler; $this->moduleInstaller = $module_installer; $this->keyValueExpirable = $key_value_expirable; - $this->schema = $schema; + $this->schemaInstaller = $schema_installer; } /** @@ -154,7 +154,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { // All modules which depend on this one must be uninstalled first, before // we can allow this module to be uninstalled. foreach (array_keys($module->required_by) as $dependent) { - if ($this->schema->getInstalledVersion($dependent) != SCHEMA_UNINSTALLED) { + if ($this->schemaInstaller->getInstalledVersion($dependent) != SCHEMA_UNINSTALLED) { $name = isset($modules[$dependent]->info['name']) ? $modules[$dependent]->info['name'] : $dependent; $form['modules'][$module->getName()]['#required_by'][] = $name; $form['uninstall'][$module->getName()]['#disabled'] = TRUE;