_registry_parse_files

Definition

_registry_parse_files($files)
drupal/includes/registry.inc, line 113

Description

Parse all files that have changed since the registry was last built, and save their function and class listings.

Parameters

$files The list of files to check and parse.

Related topics

Namesort iconDescription
Code registryThe code registry engine.

Code

function _registry_parse_files($files) {
  $parsed_files = array();
  foreach ($files as $filename => $file) {
    $contents = file_get_contents($filename);
    $md5 = md5($contents);
    $new_file = !isset($file['md5']);
    if ($new_file || $md5 != $file['md5']) {
      $parsed_files[] = $filename;
      // We update the md5 after we've saved the files resources rather than here, so if we
      // don't make it through this rebuild, the next run will reparse the file.
      _registry_parse_file($filename, $contents, $file['module'], $file['weight']);
      $file['md5'] = $md5;
      db_merge('registry_file')
        ->key(array('filename' => $filename))
        ->fields(array('md5' => $md5))
        ->execute();
    }
  }
  return $parsed_files;
}