-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fluent mapping path loader #48
base: 1.1
Are you sure you want to change the base?
Conversation
patrickbrouwers
commented
Jul 4, 2017
e2e1441
to
d3487ef
Compare
$sourceFile = realpath($sourceFile); | ||
} | ||
|
||
require_once $sourceFile; |
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.
@patrickbrouwers I don't like this strategy, because it depends on those files not being previously loaded. I don't know what would happen with opcache, for example.
I think we talked about this in the previous PR.
I'd agree to merge as-is, but I wouldn't trust this strategy for my projects.
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.
This is actually copy pasted from the AnnotationsDriver.
|
||
$declared = get_declared_classes(); | ||
|
||
foreach ($declared as $className) { |
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.
@patrickbrouwers this list could be huge. We could use some convention to skip building a ReflectionClass for each loaded class in the system... Or maybe parse filename and class name and only reflect on basename matches.
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 that would require people to actually have a ...Mapping.php
suffix.
Like previous comment, this is also the way the AnnotationsDriver does things. It's cached in production anyway.
f6c1573
to
955ea6e
Compare
955ea6e
to
eee1bfc
Compare