You are here

public function DefaultFileLocator::getAllClassNames in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php \Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator::getAllClassNames()

Gets 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

vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php, line 126

Class

DefaultFileLocator
Locates 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;
}