public function DefaultFileLocator::getAllClassNames

Get all class names that are found with this file locator.

Parameters

string $globalBasename Passed to allow excluding the basename:

Return value

array

Overrides FileLocator::getAllClassNames

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php, line 123

Class

DefaultFileLocator
Locate the file that contains the metadata information for a given class name.

Namespace

Doctrine\Common\Persistence\Mapping\Driver

Code

public function getAllClassNames($globalBasename) {
  $classes = array();
  if ($this->paths) {
    foreach ($this->paths as $path) {
      if (!is_dir($path)) {
        throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
      }
      $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
      foreach ($iterator as $file) {
        $fileName = $file
          ->getBasename($this->fileExtension);
        if ($fileName == $file
          ->getBasename() || $fileName == $globalBasename) {
          continue;
        }

        // NOTE: All files found here means classes are not transient!
        $classes[] = str_replace('.', '\\', $fileName);
      }
    }
  }
  return $classes;
}