_system_is_incompatible

Versions
6 – 7
_system_is_incompatible(&$incompatible, $files, $file)

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.

▾ 2 functions call _system_is_incompatible()

system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.
_system_is_incompatible in modules/system/system.admin.inc
Recursively check compatibility.

Code

modules/system/system.admin.inc, line 579

<?php
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;
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.