ModuleInstaller.php in Service Container 7
File
src/Extension/ModuleInstaller.php
View source
<?php
namespace Drupal\service_container\Extension;
use Drupal\Core\Extension\ModuleInstallerInterface;
use Drupal\Core\Extension\ModuleUninstallValidatorInterface;
use Drupal\service_container\Legacy\Drupal7;
class ModuleInstaller implements ModuleInstallerInterface {
protected $drupal7;
public function __construct(Drupal7 $drupal7) {
$this->drupal7 = $drupal7;
}
public function install(array $module_list, $enable_dependencies = TRUE) {
$this->drupal7
->module_enable($module_list, $enable_dependencies);
}
public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
$this->drupal7
->module_disable($module_list, $uninstall_dependents);
$this->drupal7
->drupal_uninstall_modules($module_list);
}
public function addUninstallValidator(ModuleUninstallValidatorInterface $uninstall_validator) {
throw new \BadMethodCallException(sprintf('%s is not implemented', __FUNCTION__));
}
public function validateUninstall(array $module_list) {
throw new \BadMethodCallException(sprintf('%s is not implemented', __FUNCTION__));
}
}