-
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
[FEATURE] Allow loading mappings from paths #41
Conversation
Fluent will check the "paths" node in the doctrine config for an array of directories which it should load mapping files from
$getting_namespace = $getting_class = false; | ||
|
||
//Go through each token and evaluate it as necessary | ||
foreach (token_get_all($contents) as $token) { |
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.
@FoxxMD this is why I didn't add the file parser right away. Tokenizing a file's contents seems overkill, when the alternative is to list the FQCNs in the config and be done with it.
I'm not comfortable with the current solution, I don't know what @patrickbrouwers thinks about it.
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 alternative is adding 80+ lines to my doctrine config, for each manager. It gets unwieldy. Plus with paths I don't have to update my doctrine config each time I add a new mapping, just add the mapping and be done with it.
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.
Let me see if I can get doctrine's way to work...
Instead of tokenizing just require all files in paths and then use reflection and declared classes to find mapping classes
So all tests pass
} | ||
|
||
$sourceFile = realpath($file->getPathName()); | ||
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.
Keeping this open as reminder, but I'd prefer a different solution. |
Replaced by #48 |
Fluent will check the "paths" node in the doctrine config for an array of directories which it should load mapping files from
Changes proposed in this pull request: