コード例 #1
0
ファイル: PhpDriver.php プロジェクト: nvdnkpr/symfony-demo
 /**
  * {@inheritDoc}
  */
 public function getAllClassNames()
 {
     $classes = array();
     if ($this->_paths) {
         foreach ((array) $this->_paths as $path) {
             if (!is_dir($path)) {
                 throw MappingException::phpDriverRequiresConfiguredDirectoryPath();
             }
             $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
             foreach ($iterator as $file) {
                 if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {
                     continue;
                 }
                 $classes[] = $fileName;
                 $this->_classPaths[$fileName] = $file->getPathName();
             }
         }
     }
     return $classes;
 }