-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
AnnotationFileLoader breaks on OSX Mounted Drives in Symfony 3.2.0 #21497
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
Comments
Besides of OSX modifying this (which sounds really wonky if you ask me), for this particular (OS Level) case, an exception could be made to exclude that directory. The problem is, if there's 1 exception to the rule, there are more. |
I wasn't aware of this
I'd say we should take care of this and exclude the |
This looks like a bug in the loader, which should not go into any dot
directory to me.
|
…om annotations (jakzal) This PR was merged into the 2.7 branch. Discussion ---------- [Routing] Ignore hidden directories when loading routes from annotations | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21497 | License | MIT | Doc PR | - The problem surfaced after implementing #18869. Therefore it doesn't exist on 2.7, but I'd still merge it there to avoid conflicts when merging between branches. Without this fix, the oldest branch the added test will fail is 3.2. Commits ------- ce9df02 [Routing] Ignore hidden directories when loading routes from annotations
I develop in my local environment on OSX using a mounted network drive that is my Linux VM.
Some of you might know that OSX handles files and metadata from mounted drives in an interesting way. It creates an ".AppleDouble" directory, and then creates files in that directory that match the names of the parent directory (ie, Controller/BlogController.php and it creates Controller/.AppleDouble/BlogController.php that contains the metadata).
These files store encoded data about the original files. Because of that, they do not contain a php start tag (<?php)
I updated to Symfony 3.2.0 this morning and started receiving this exception:
Everything works in 3.1.* and upon further examination, the change causing this was in PR #18869
That change occurred to assist in people who had copied and pasted code from a tutorial that did not have a start tag. Instead of it silently failing, it now throws an exception in the findClass() method of the AnnotationFileLoader to give a clearer reason why it failed.
The situation is that now it is attempting to load the ".php" files in my .AppleDouble directories, assuming they are actual PHP files, and it is not able to find a start tag, so an exception is thrown. In the past, it would simply not load those files, and my application would work.
I would rather not have to create a custom loader to get around this. Any thoughts or suggestions on what I can do? Thanks!
The text was updated successfully, but these errors were encountered: