function _registry_parse_files in Drupal 7
Parse all changed files and save their interface and class listings.
Parse all files that have changed since the registry was last built, and save their interface and class listings.
Parameters
$files: The list of files to check and parse.
Related topics
2 calls to _registry_parse_files()
- RegistryParseFilesTestCase::testRegistryParseFiles in modules/
simpletest/ tests/ registry.test - testRegistryParseFiles
- _registry_update in includes/
registry.inc - Does the work for registry_update().
File
- includes/
registry.inc, line 156 - 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);
}