diff --git a/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php index 914a7579e..6668e610e 100644 --- a/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php @@ -219,7 +219,11 @@ public function getAllClassNames() ); foreach ($iterator as $file) { - $sourceFile = realpath($file[0]); + $sourceFile = $file[0]; + + if ( ! preg_match('(^phar:)i', $sourceFile)) { + $sourceFile = realpath($sourceFile); + } foreach ($this->excludePaths as $excludePath) { $exclude = str_replace('\\', '/', realpath($excludePath)); diff --git a/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php b/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php new file mode 100644 index 000000000..ab6cc5ce4 --- /dev/null +++ b/tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php @@ -0,0 +1,29 @@ +getAllClassNames(); + + $this->assertEquals(array('Doctrine\TestClass'), $classes); + } +} + +class SimpleAnnotationDriver extends AnnotationDriver +{ + protected $entityAnnotationClasses = array('Doctrine\Entity' => true); + + public function loadMetadataForClass($className, ClassMetadata $metadata) + { + } +} diff --git a/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php new file mode 100644 index 000000000..ff0356821 --- /dev/null +++ b/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php @@ -0,0 +1,17 @@ +