class ModuleInstaller in Service Container 7
Same name and namespace in other branches
- 7.2 src/Extension/ModuleInstaller.php \Drupal\service_container\Extension\ModuleInstaller
Provides a module installer compatible with D7.
@codeCoverageIgnore
Hierarchy
- class \Drupal\service_container\Extension\ModuleInstaller implements ModuleInstallerInterface
Expanded class hierarchy of ModuleInstaller
File
- src/
Extension/ ModuleInstaller.php, line 19 - Contains \Drupal\service_container\Extension\ModuleInstaller.
Namespace
Drupal\service_container\ExtensionView source
class ModuleInstaller implements ModuleInstallerInterface {
/**
* The Drupal7 service.
*
* @var \Drupal\service_container\Legacy\Drupal7
*/
protected $drupal7;
/**
* Constructs a new ModuleInstaller instance.
*
* @param \Drupal\service_container\Legacy\Drupal7 $drupal7
* The Drupal7 service.
*/
public function __construct(Drupal7 $drupal7) {
$this->drupal7 = $drupal7;
}
/**
* {@inheritdoc}
*/
public function install(array $module_list, $enable_dependencies = TRUE) {
$this->drupal7
->module_enable($module_list, $enable_dependencies);
}
/**
* {@inheritdoc}
*/
public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
$this->drupal7
->module_disable($module_list, $uninstall_dependents);
$this->drupal7
->drupal_uninstall_modules($module_list);
}
/**
* {@inheritdoc}
*/
public function addUninstallValidator(ModuleUninstallValidatorInterface $uninstall_validator) {
throw new \BadMethodCallException(sprintf('%s is not implemented', __FUNCTION__));
}
/**
* {@inheritdoc}
*/
public function validateUninstall(array $module_list) {
throw new \BadMethodCallException(sprintf('%s is not implemented', __FUNCTION__));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ModuleInstaller:: |
protected | property | The Drupal7 service. | |
ModuleInstaller:: |
public | function |
Adds module a uninstall validator. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function |
Installs a given list of modules. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function |
Uninstalls a given list of modules. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function |
Determines whether a list of modules can be uninstalled. Overrides ModuleInstallerInterface:: |
|
ModuleInstaller:: |
public | function | Constructs a new ModuleInstaller instance. |