Skip to content

Conversation

FoxxMD
Copy link
Member

@FoxxMD FoxxMD commented Oct 24, 2016

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:

  • Fluent will check the "paths" node in the doctrine config for an array of directories which it should load mapping files from and then load them

Fluent will check the "paths" node in the doctrine config for an array of directories which it should load mapping files from
//Set helper values to know that we have found the namespace/class token and need to collect the string values after them
$getting_namespace = $getting_class = false;

//Go through each token and evaluate it as necessary
Copy link
Contributor

@guiwoda guiwoda Oct 24, 2016

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.

Copy link
Member Author

@FoxxMD FoxxMD Oct 24, 2016

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.

Copy link
Member Author

@FoxxMD FoxxMD Oct 24, 2016

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
continue;
}

$sourceFile = realpath($file->getPathName());
Copy link
Member Author

@FoxxMD FoxxMD Oct 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guiwoda This is how doctrine finds classes for the StaticPHPDriver

@patrickbrouwers
Copy link
Contributor

Keeping this open as reminder, but I'd prefer a different solution.

@patrickbrouwers
Copy link
Contributor

Replaced by #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants