class ModuleBlacklistModuleInstaller in Module Blacklist 8
Class ModuleBlacklistModuleInstaller.
@package Drupal\module_blacklist
Hierarchy
- class \Drupal\Core\Extension\ModuleInstaller implements ModuleInstallerInterface
- class \Drupal\module_blacklist\ModuleBlacklistModuleInstaller
Expanded class hierarchy of ModuleBlacklistModuleInstaller
1 string reference to 'ModuleBlacklistModuleInstaller'
1 service uses ModuleBlacklistModuleInstaller
File
- src/
ModuleBlacklistModuleInstaller.php, line 12
Namespace
Drupal\module_blacklistView source
class ModuleBlacklistModuleInstaller extends ModuleInstaller {
/**
* Performs module pre-install rollback operations.
*
* This method performs rollback operations for module installation process
* executed before the invocation of the hook hook_module_preinstall().
*
* @param string $module
* The module name.
*/
public function rollbackPreinstall($module) {
// Remove the module's entry from the config. Don't check schema when
// uninstalling a module since we are only clearing a key.
\Drupal::configFactory()
->getEditable('core.extension')
->clear("module.{$module}")
->save(TRUE);
// Update the module handler to remove the pre-installed module.
$module_filenames = $this->moduleHandler
->getModuleList();
unset($module_filenames[$module]);
$this->moduleHandler
->setModuleList($module_filenames);
// Clear the static cache of system_rebuild_module_data() to pick up the
// new module, since it merges the installation status of modules into
// its statically cached list.
drupal_static_reset('system_rebuild_module_data');
// Update the kernel to exclude the uninstalled modules.
$this
->updateKernel($module_filenames);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ModuleBlacklistModuleInstaller:: |
public | function | Performs module pre-install rollback operations. | |
ModuleInstaller:: |
protected | property | The drupal kernel. | |
ModuleInstaller:: |
protected | property | The module handler. | |
ModuleInstaller:: |
protected | property | The app root. | |
ModuleInstaller:: |
protected | property | The uninstall validators. | |
ModuleInstaller:: |
public | function |
Adds module a uninstall validator. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function |
Installs a given list of modules. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
protected | function | Helper method for removing all cache bins registered by a given module. | |
ModuleInstaller:: |
public | function |
Uninstalls a given list of modules. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
protected | function | Updates the kernel module list. | |
ModuleInstaller:: |
public | function |
Determines whether a list of modules can be uninstalled. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function | Constructs a new ModuleInstaller instance. |