You are here

public static function Check::canUse in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/Check.php \HookUpdateDeployTools\Check::canUse()

Evaluates if a module can be used.

Parameters

string $module_name: The machine name of a module.

Return value

bool TRUE if the module exists.

Throws

HudtException if the module does not exist.

10 calls to Check::canUse()
Features::revert in src/Features.php
Safely revert an array of Features and provide feedback.
Menus::canImport in src/Menus.php
Checks to see if menu_import in enabled.
PageManager::canExport in src/PageManager.php
Checks to see if Panels pages can be exported.
PageManager::canImport in src/PageManager.php
Checks if Page Manager is enabled and import functions are available.
Paths::getAliasObject in src/Paths.php
Build and get the $alias object to be passed around.

... See full list

File

src/Check.php, line 47

Class

Check
Public methods for dealing with Checking things.

Namespace

HookUpdateDeployTools

Code

public static function canUse($module_name) {
  if (!empty($module_name) && module_exists($module_name)) {
    return TRUE;
  }
  else {
    $message = "The module '@name' does not exist and can not be used.";
    $vars = array(
      '@name' => $module_name,
    );
    throw new HudtException($message, $vars, WATCHDOG_ERROR, TRUE);
  }
}