function _registry_parse_files

7.x registry.inc _registry_parse_files($files)

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

2 calls to _registry_parse_files()
RegistryParseFilesTestCase::testRegistryParseFiles in drupal-7.x/modules/simpletest/tests/registry.test
testRegistryParseFiles
_registry_update in drupal-7.x/includes/registry.inc
Does the work for registry_update().

File

drupal-7.x/includes/registry.inc, line 128
This file contains the code registry parser engine.

Code

function _registry_parse_files($files) {
  $parsed_files = array();
  foreach ($files as $filename => $file) {
    if (file_exists($filename)) {
      $hash = hash_file('sha256', $filename);
      if (empty($file['hash']) || $file['hash'] != $hash) {
        $file['hash'] = $hash;
        $parsed_files[$filename] = $file;
      }
    }
  }
  foreach ($parsed_files as $filename => $file) {
    _registry_parse_file($filename, file_get_contents($filename), $file['module'], $file['weight']);
    db_merge('registry_file')
      ->key(array('filename' => $filename))
      ->fields(array(
        'hash' => $file['hash'],
      ))
      ->execute();
  }
  return array_keys($parsed_files);
}