You are here

function xautoload_autoload_info in X Autoload 6

Implements hook_autoload_info()

Give modules the choice to have their autoloadable classes registered in the registry with autoload.module, for better autoload performance.

File

./xautoload.module, line 74

Code

function xautoload_autoload_info() {

  // Get current list of modules and their files.
  $modules = array();
  $query = db_query("SELECT * FROM {system} WHERE type = 'module'");

  // Get the list of files we are going to parse.
  $locations = array();
  $scanner = new xautoload_DirScanner($locations);
  while ($module = db_fetch_object($query)) {
    $info = unserialize($module->info);
    if (!empty($info['autoload'])) {
      $dir = dirname($module->filename);
      $scanner
        ->scan("{$dir}/lib", $module->name);
    }
  }
  return $locations;
}