You are here

function coder_upgrade_library_checks in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/coder_upgrade.inc \coder_upgrade_library_checks()

Checks for proper installation of required modules and library.

@todo Remove this once everyone gets used to the library concept.

Return value

boolean TRUE if required modules and library are installed; FALSE otherwise.

Deprecated

No longer used.

1 call to coder_upgrade_library_checks()
coder_upgrade_conversions_form in coder_upgrade/includes/conversion.inc
Form builder for the module conversion form.

File

coder_upgrade/coder_upgrade.inc, line 180
Provides constants and utility functions.

Code

function coder_upgrade_library_checks() {
  $modules = system_list('module_enabled');
  $messages = array();
  if (isset($modules['grammar_parser'])) {
    $messages[] = 'Grammar Parser should NOT be installed and enabled as a module.';
    $messages[] = 'Grammar Parser should be installed as a library using a 2.x release of Libraries API module.';
  }
  if (isset($modules['libraries'])) {
    if (!isset($modules['libraries']->info['version']) || substr($modules['libraries']->info['version'], 0, 6) != '7.x-2.') {
      $messages[] = 'Coder Upgrade requires a 7.x-2.x release of the Libraries API module.';
    }
    if (function_exists('libraries_get_path') && libraries_get_path('grammar_parser') === FALSE) {
      $messages[] = 'Grammar Parser should be installed as a library using a 2.x release of Libraries API module.';
    }
  }
  else {
    $messages[] = 'Coder Upgrade requires a 7.x-2.x release of the Libraries API module.';
    $messages[] = 'Grammar Parser should be installed as a library using a 2.x release of Libraries API module.';
  }
  foreach ($messages as $message) {
    drupal_set_message(t($message), 'error');
  }
  return empty($messages);
}