function Module::isInstalled

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::isInstalled()
  2. 10 core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::isInstalled()
  3. 11.x core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::isInstalled()

Overrides UpdaterInterface::isInstalled

1 call to Module::isInstalled()
Module::getInstallDirectory in core/lib/Drupal/Core/Updater/Module.php
Returns the directory where a module should be installed.

File

core/lib/Drupal/Core/Updater/Module.php, line 49

Class

Module
Defines a class for updating modules using <a href="/api/drupal/core%21lib%21Drupal%21Core%21FileTransfer%21FileTransfer.php/class/FileTransfer/8.9.x" title="Defines the base FileTransfer class." class="local">Drupal\Core\FileTransfer\FileTransfer</a> classes via <a href="/api/drupal/core%21authorize.php/8.9.x" title="Administrative script for running authorized file operations." class="local">authorize.php</a>.

Namespace

Drupal\Core\Updater

Code

public function isInstalled() {
    // Check if the module exists in the file system, regardless of whether it
    // is enabled or not.
    
    /** @var \Drupal\Core\Extension\ExtensionList $module_extension_list */
    $module_extension_list = \Drupal::service('extension.list.module');
    return $module_extension_list->exists($this->name);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.