-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
BUG: Reflection cache for class is not flushed on file deletion #3303
Comments
This was referenced Feb 4, 2024
Also when enums get deleted they seem to crash the compilation of flow because
|
mhsdesign
added a commit
to mhsdesign/flow-development-collection
that referenced
this issue
Jul 27, 2024
There are a few layers to this bugfix. 1. Previously we ignored deleted files (see `file_exists`) and did not flush the `Flow_Reflection_Status` cache accordingly as we are not able to read the namespace from a deleted php file. Now we do a best effort reverse lookup by going through all psr-4 autoload configurations and calculate a namespace under which composer would have found this file. 2. We introduce a state `removedReflectionDataClasses` like `updatedReflectionData` which will be used to check if we have to update the `ReflectionData` cache.
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That leads to
forgetClass
not being fired andallImplementationsForInterface
returning stale classes which leads to places using that and instantiating objects like the property mapper crash if a property mapper was deleted:This seems to be a regression from e7c00fa as the early return in
file_exists($pathAndFilename)
will prevent the cache flushing.The early return was a necessary evil to support psr4. Previously the class name was inferred by location (that it resides in
Classes
), now we scan its contents and build it.We should probably get the autoloading paths configuration from the package and build a path that way? But that information is not at hand at that time.
I guess we have to add the path to the
Flow_Object_Classes
as well?The text was updated successfully, but these errors were encountered: