persistence
persistence copied to clipboard
Make the annotation driver to work with phars under Windows
The current implementation of AnnotationDriver
doesn't work in Windows when the application runs inside a phar.
The RecursiveDirectoryIterator
at line 221 will search in subdirectories of $path
, but under Windows entities and repositories get a backslash after the path:
phar://path/to/phar/src/AppBundle\MyEntity.php
Because of the check at line 247 the entity is simply ignored (ReflectionClass
always returns forward slashes because source file is inside the phar itself)
phar://path/to/phar/src/AppBundle/MyEntity.php
I think it will be enough a replace when iterating file files (the same is done at line 228):
foreach ($iterator as $file) {
$sourceFile = str_replace('\\', '/', $file[0]);
// ...
}
Anyone interested in this?