-
Notifications
You must be signed in to change notification settings - Fork 122
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
added flag parameter for enabling AuditController #161
added flag parameter for enabling AuditController #161
Conversation
100f74d
to
5c46317
Compare
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.
@p365labs thanks for the contribution.
Though, your PR does not do exactly what you expect it to do: the compiler pass removes the controller definition but routes still get registered and trying to access such a route triggers a LogicException
with message "DH\DoctrineAuditBundle\Controller\AuditController" has no container set, did you forget to define it as a service subscriber?
481fc95
to
37836ff
Compare
Hi, @DamienHarper you're right, I missed a piece. |
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.
I haven't tested yet but it looks very promising
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.
I haven't tested yet but that seems good to me
src/DoctrineAuditBundle/DependencyInjection/Compiler/DisableAuditControllerPass.php
Outdated
Show resolved
Hide resolved
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.
Looks good to me, thanks for the contribution!
@p365labs a conflict remains about |
deee012
to
12c9017
Compare
@DamienHarper my fault, I probably forgot to rebase from master. now should be ok. |
@DamienHarper & @maxhelias Hi all, I implemented a solution to programmatically disable AuditController::class,
this way a new configuration parameter could be set to false and that controller and its routes won't be available.
The use case to cover is a use case in which the library is used to store informatin on the persistence layer but they will be available in a different way to the user, for example through API.
The controller routes won't be exposed to any environment.
The parameter is:
enable_audit_controller
and has been added to the Configuration.php file.
reference issue #153