persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Make the annotation driver to work with phars under Windows

Open gremo opened this issue 8 years ago • 1 comments

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]);

    // ...
}

gremo avatar Apr 18 '16 19:04 gremo

Anyone interested in this?

gremo avatar Aug 06 '16 12:08 gremo