Closed mikeerickson closed 10 years ago
I've thought about this, and the problem is that it might encourage people to use Anbu in a production environment. I'd rather they only register its SP within a development env config file. What do you think?
What would be the danger of using Anbu in production as long as it's disabled?
The reason I listen to app.debug in laravel-debugbar (and what I've seen from most other profilers), is that you sometimes want to enable it at runtime (for specific IPs, admin users etc to 'hotfix' something), or because I tend to forget to remove a debug statement, which would crash when the SP isn't registered. I would think the impact should be minimal if you don't actually debug/listen to events and change the output.
@daylerees maybe you could put a guard in the service provider, and if the env is production (or not local/testing/wathever) return without continuing, preventing the /anbu routes and everything else from appearing, even if the button is hidden.
+1 I was going to request this but was waiting for the first beta release since dayle is already putting in so much work into this and mentioned not to submit bugfix/prs yet.
Another library that does this is Barryvdh\Debugbar
:+1: for doing it like debugbar does. It has an enabled
config key which by default is set to Config::get('app.debug')
, so people can manually just set it to true/false if they want to.
https://github.com/barryvdh/laravel-debugbar/blob/v1.7.6/src/config/config.php#L16
I say ditto to @GrahamCampbell and @timReynolds' comments. FWIW.
Bud
I also like the debugbar approach :)
I know it's a bit lazy but I like to turn debug on momentarily if I encounter unexpected behaviour in production (our app is internal so this isn't too bad), having Anbu turn on at the same time would be great!
Maybe something like a maintenance command.
php artisan anbu:debug up/down/status
or
php artisan anbu:debug on/off/status
with status you can check if the current application is in debug mode. This way when deploying its always off and can be turned on by these commands.
@daylerees is your only concern that some people might turn it on in production which will affect performance and probably security? Would be good to understand your thoughts, generally people seem to like the convenience of it being linked to app.debug
Hi guys, performance and security are my main concerns. However, it looks like the majority would be interested in having a configuration key, with a default value of app.debug
. I'll make this happen in the next alpha which shouldn't be too long now.
@daylerees Thanks mate!
Is there any chance you could add support for displaying profiler button when in debug mode ONLY? I have hacked it together, but since this is still a fluid project (with many more updates coming) figured it would be better to have you add it to package.