-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Ability to call setFilterSchemaAssetsExpression multiple times (or create an array of FilterSchema expressions) #3196
Comments
Given that currently assets are filtered by a regular expression, it's indeed hard to extend. A trick with combining multiple regular expressions in one using positive lookaheads requires the pieces to not contain the delimiters and flags which is not the case here. The ability to Instead, @Majkl578, @Ocramius, do you have an opinion? I haven't used this API myself. |
I don't use this feature either, but regex-based filtering obviously reaches its limits very easily. Please do not attempt to extend the regex support, and do not start with regex parsers. Instead, let's see if a different API (callback-based, like @morozov proposed) can be implemented. |
@morozov A callback implementation could work with as proposed. The only question is how to preserve backward compatibility with the existing regex filter. Maybe the default callable stored could be the existing regex function (while the old method is marked as |
@mmucklo yes, we need a backward-compatible solution. To summarize your suggestion above:
This way, if the caller doesn't set the callback filter, the regex will work. If a regex filter is set, it will work via both callback and regex APIs. |
Fixed by #3308. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Summary
First thanks for all the hard work on this core library. It's been fantastic to have something like this to use.
I'm presently maintaining a symfony bundle that allows people to use either Doctrine ORM or ODM as their datastore, as well as other options (DtcQueueBundle). One of the requests has been if people don't use ORM, then the Doctrine Migrator shouldn't generate the tables for it See this issue.
This traces back to setFilterSchemaAssetsExpression which of course I could call in my compiler pass if ORM is not used, however it only allows a single filter at a time, so if someone sets a filter in their schema_filter symfony configuration, I can't add an additional filter on top of that to filter out the DtcQueueBundle tables without overwriting that filter.
I could write code to parse any existing filter's regular expression and then add additional regular criteria to the same original one, but that seems tricky and prone to error.
I'd rather just have the ability to "addFilterSchemaAssetsExpression" and the filter expressions be treated like an array.
Nevertheless if there's a better way to do this, I'm all ears.
The text was updated successfully, but these errors were encountered: