Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ClassLoader] replaced MapFileClassLoader by MapClassLoader
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about extraction interface
ClassLoaderInterface
with methodsloadClass
,findFile
? And removing extendingUniversalClassLoader
inApcUniversalClassLoader
andDebugUniversalClassLoader
classes.cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Koc why would you remove the inheritance ? It would lead to code duplication
cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What code will duplicated? I think only
loadClass
method, so we can createJust I think that there is no logic in "apc loader is special case (child) of universal loader". And in theory we can wrap
DebugUniversalClassLoader
not only onUniversalClassLoader
but forMapClassLoader
too.cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Apc loader calls the logic of the parent class when the location of the file is not cached yet.
cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use wrapping
cc07af2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this would mean that the end-user has to wrap define a UniversalClassLoader (without registering it) and then wrapping it in the Apc loader which would be registered. the inheritance is more user-friendly here IMO.
Thus, using the ApcUniversalClassLoader to wrap the MapClassLoader does not make any sense: it adds overhead without any value. The ApcUniversalClassLoader is meant to optimize filesystem calls in the UniversalClassLoader.