You are here

function _system_is_incompatible in Drupal 6

Same name and namespace in other branches
  1. 7 modules/system/system.admin.inc \_system_is_incompatible()

Recursively check compatibility.

Parameters

$incompatible: An associative array which at the end of the check contains all incompatible files as the keys, their values being TRUE.

$files: The set of files that will be tested.

$file: The file at which the check starts.

Return value

Returns TRUE if an incompatible file is found, NULL (no return value) otherwise.

1 call to _system_is_incompatible()
system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.

File

modules/system/system.admin.inc, line 589
Admin page callbacks for the system module.

Code

function _system_is_incompatible(&$incompatible, $files, $file) {
  static $seen;

  // We need to protect ourselves in case of a circular dependency.
  if (isset($seen[$file->name])) {
    return isset($incompatible[$file->name]);
  }
  $seen[$file->name] = TRUE;
  if (isset($incompatible[$file->name])) {
    return TRUE;
  }

  // The 'dependencies' key in .info files was a string in Drupal 5, but changed
  // to an array in Drupal 6. If it is not an array, the module is not
  // compatible and we can skip the check below which requires an array.
  if (!is_array($file->info['dependencies'])) {
    $file->info['dependencies'] = array();
    $incompatible[$file->name] = TRUE;
    return TRUE;
  }

  // Recursively traverse the dependencies, looking for incompatible modules
  foreach ($file->info['dependencies'] as $dependency) {
    if (isset($files[$dependency]) && _system_is_incompatible($incompatible, $files, $files[$dependency])) {
      $incompatible[$file->name] = TRUE;
      return TRUE;
    }
  }
}