You are here

public function ExtensionList::checkIncompatibility in Drupal 9

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

Tests the compatibility of an extension.

Parameters

string $name: The extension name to check.

Return value

bool TRUE if the extension is incompatible and FALSE if not.

Throws

\Drupal\Core\Extension\Exception\UnknownExtensionException If there is no extension with the supplied name.

File

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

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function checkIncompatibility($name) {
  $extension = $this
    ->get($name);
  return $extension->info['core_incompatible'] || isset($extension->info['php']) && version_compare(phpversion(), $extension->info['php']) < 0;
}