diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 36737dd..0c7c4ad 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -993,7 +993,7 @@ function install_base_system(&$install_state) { // Enable the user module so that sessions can be recorded during the // upcoming bootstrap step. - module_install(array('user'), FALSE); + Drupal::moduleHandler()->install(array('user'), FALSE); // Save the list of other modules to install for the upcoming tasks. // variable_set() can be used now that system.module is installed. @@ -2029,7 +2029,7 @@ function _install_module_batch($module, $module_name, &$context) { // loaded by drupal_bootstrap in subsequent batch requests, and other // modules possibly depending on it can safely perform their installation // steps. - module_install(array($module), FALSE); + Drupal::moduleHandler()->install(array($module), FALSE); $context['results'][] = $module; $context['message'] = t('Installed %module module.', array('%module' => $module_name)); } @@ -2523,7 +2523,7 @@ function install_configure_form_submit($form, &$form_state) { // Enable update.module if this option was selected. if ($form_state['values']['update_status_module'][1]) { - module_install(array('file', 'update'), FALSE); + Drupal::moduleHandler()->install(array('file', 'update'), FALSE); // Add the site maintenance account's email address to the list of // addresses to be notified when updates are available, if selected. diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 422b920..9dd66f7 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -538,7 +538,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { } // Only process currently uninstalled modules. - $module_config = \Drupal::config('system.module'); + $module_config = $this->container->get('config.factory')->get('system.module'); $installed_modules = $module_config->get('enabled') ?: array(); if (!$module_list = array_diff_key($module_list, $installed_modules)) { // Nothing to do. All modules already enabled. @@ -631,7 +631,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { // taken over as %container.modules% parameter, which is passed to a fresh // ModuleHandler instance upon first retrieval. // @todo install_begin_request() creates a container without a kernel. - if ($kernel = \Drupal::service('kernel', ContainerInterface::NULL_ON_INVALID_REFERENCE)) { + if ($kernel = $this->container->get('kernel', ContainerInterface::NULL_ON_INVALID_REFERENCE)) { $kernel->updateModules($module_filenames, $module_filenames); } @@ -694,7 +694,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { } // Only process currently installed modules. - $module_config = \Drupal::config('system.module'); + $module_config = $this->container->get('config.factory')->get('system.module'); $installed_modules = $module_config->get('enabled') ?: array(); if (!$module_list = array_intersect_key($module_list, $installed_modules)) { // Nothing to do. All modules already uninstalled. @@ -733,7 +733,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { // configured as enabled. Custom or overridden module handlers might contain // the module already, which means that it might be loaded, but not // necessarily installed or enabled. - $schema_store = \Drupal::keyValue('system.schema'); + $schema_store = $this->container->get('keyvalue')->get('system.schema'); foreach ($module_list as $module) { // Allow modules to react prior to the uninstallation of a module. $this->invokeAll('module_preuninstall', array($module)); @@ -771,7 +771,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { _system_update_bootstrap_status(); // Update the kernel to exclude the uninstalled modules. - \Drupal::service('kernel')->updateModules($module_filenames, $module_filenames); + $this->container->get('kernel')->updateModules($module_filenames, $module_filenames); // Update the theme registry to remove the newly-disabled module. drupal_theme_rebuild(); @@ -811,7 +811,7 @@ protected function removeCacheBins($module) { // be extremely rare. if ($tag['name'] == 'cache.bin' && isset($definition['factory_service']) && isset($definition['factory_method']) && !empty($definition['arguments'])) { try { - $factory = \Drupal::service($definition['factory_service']); + $factory = $this->container->get($definition['factory_service']); if (method_exists($factory, $definition['factory_method'])) { $backend = call_user_func_array(array($factory, $definition['factory_method']), $definition['arguments']); if ($backend instanceof CacheBackendInterface) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/InstallUninstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallUninstallTest.php index c697f70..76889b0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/InstallUninstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/InstallUninstallTest.php @@ -128,7 +128,7 @@ public function testInstallUninstall() { // If all checkboxes were disabled, something is really wrong with the // test. Throw a failure and avoid an infinite loop. if ($initial_count == $final_count) { - $this->fail(t('Remaining modules could not be disabled.')); + $this->fail('Remaining modules could not be disabled.'); break; } }