You are here

function _module_build_dependents in Drupal 5

Find dependents; modules that are required by other modules. Adds an array of dependents to the $file->info array.

Return value

The list of files array with dependents added where applicable.

1 call to _module_build_dependents()
module_rebuild_cache in includes/module.inc
Rebuild the database cache of module files.

File

includes/module.inc, line 143
API for loading and interacting with Drupal modules.

Code

function _module_build_dependents($files) {
  foreach ($files as $filename => $file) {
    if (isset($file->info['dependencies']) && is_array($file->info['dependencies'])) {
      foreach ($file->info['dependencies'] as $dependency) {
        if (!empty($files[$dependency]) && is_array($files[$dependency]->info)) {
          if (!isset($files[$dependency]->info['dependents'])) {
            $files[$dependency]->info['dependents'] = array();
          }
          $files[$dependency]->info['dependents'][] = $filename;
        }
      }
    }
  }
  return $files;
}