You are here

function _autoload_registry_parse_file in Autoload 6.2

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

1 call to _autoload_registry_parse_file()
_autoload_registry_parse_files in ./autoload.registry.inc
Parse a file and save its function and class listings.

File

./autoload.registry.inc, line 139
This file contains the code registry parser engine. This file is backported from Drupal 7 core's registry.inc file.

Code

function _autoload_registry_parse_file($filename, $contents, $module = '', $weight = 0) {
  if (preg_match_all('/^\\s*(?:abstract)?\\s*(class|interface)\\s+([a-zA-Z0-9_]+)/m', $contents, $matches)) {
    foreach ($matches[2] as $key => $name) {
      db_query("INSERT INTO {autoload_registry} (name, type, filename, module, weight) VALUES ('%s', '%s', '%s', '%s', %d)", array(
        $name,
        $matches[1][$key],
        $filename,
        $module,
        $weight,
      ));
    }
  }
}