Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the annotation driver to work with phars under Windows #29

Open
gremo opened this issue Apr 18, 2016 · 1 comment
Open

Make the annotation driver to work with phars under Windows #29

gremo opened this issue Apr 18, 2016 · 1 comment

Comments

@gremo
Copy link

gremo commented Apr 18, 2016

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
Copy link
Author

gremo commented Aug 6, 2016

Anyone interested in this?

@Majkl578 Majkl578 transferred this issue from doctrine/common Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant