-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
add admin option to php-server for easier debugging #932
base: main
Are you sure you want to change the base?
Conversation
@dunglas any objections to merging this? |
I'm hesitating. I would prefer keeping the "general" Caddy-related options in sync with what native Caddy commands provide. What do you think @mholt @francislavoie? |
Why not just use a Caddyfile? I don't really have an opinion on the design of a command that isn't included in vanilla Caddy. |
Personally, I'm not a fan of it either except for exactly one case: quickly switching between test directories without maintaining a caddy file and all their variants. Being able to turn on admin and running pprof is great. That being said, it is also too easy to just go into the file and change it to |
Similar to Francis, if it's not Caddy itself I don't mind if other programs add their own CLI. But if you're going for parity with the Caddy values having all the config contained in a single file/source, not spread across config file and CLI and env vars etc ... but it's really up to the application developer. |
@mholt in case you didn't realize, this command is more akin to |
That's true. In that case it doesn't really matter then IMO. Since those specialty sub commands carry config on them. |
@@ -298,7 +300,7 @@ func cmdPHPServer(fs caddycmd.Flags) (int, error) { | |||
var false bool | |||
cfg := &caddy.Config{ | |||
Admin: &caddy.AdminConfig{ | |||
Disabled: true, | |||
Disabled: !admin, |
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.
what is this?
This just adds a
--admin
option for thephp-server
command. Makes it a heck of a lot easier to profile and debug.