_registry_parse_files

Versions
7
_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

Code

includes/registry.inc, line 123

<?php
function _registry_parse_files($files) {
  $parsed_files = array();
  foreach ($files as $filename => $file) {
    $filectime = filectime($filename);
    $filemtime = filemtime($filename);
    $modified_file = !isset($file['filectime']) || !isset($file['filemtime'])
                || $filectime != $file['filectime'] || $filemtime != $file['filemtime'];
    if ($modified_file) {
      $contents = file_get_contents($filename);
      $parsed_files[] = $filename;
      // We update the filectime/filemtime 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']);
      db_merge('registry_file')
        ->key(array('filename' => $filename))
        ->fields(array(
          'filectime' => $filectime,
          'filemtime' => $filemtime,
        ))
        ->execute();
    }
  }
  return $parsed_files;
}
?>
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.