You are here

public function RegistryAutoloadSearcher::findClassFiles in Registry Autoload 7

Finds class files in the given module for the given format.

Parameters

string $path: The path to search class files in.

string $format: The format to scan for as specified in the $formatMap.

Return value

array Returns all found php files for the given module and format.

File

./registry_autoload.module, line 185
Main module for enabling core registry to support namespaced files.

Class

RegistryAutoloadSearcher
RegistryAutoloadSearcher helper class.

Code

public function findClassFiles($path, $format) {
  if (!isset($this->formatMap[$format])) {
    return array();
  }
  $directory = $path;
  $subdir = $this->formatMap[$format];
  if (!empty($subdir)) {
    $directory .= '/' . $subdir;
  }
  $class_files = file_scan_directory($directory, '/.*.php$/');
  return array_keys($class_files);
}