You are here

public function ExtensionList::exists in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::exists()

Determines if an extension exists in the filesystem.

Parameters

string $extension_name: The machine name of the extension.

Return value

bool TRUE if the extension exists (regardless installed or not) and FALSE if not.

File

core/lib/Drupal/Core/Extension/ExtensionList.php, line 225

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function exists($extension_name) {
  $extensions = $this
    ->getList();
  return isset($extensions[$extension_name]);
}