frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

add admin option to php-server for easier debugging

Open withinboredom opened this issue 1 year ago • 7 comments

This just adds a --admin option for the php-server command. Makes it a heck of a lot easier to profile and debug.

withinboredom avatar Jul 23 '24 21:07 withinboredom

@dunglas any objections to merging this?

withinboredom avatar Aug 14 '24 10:08 withinboredom

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?

dunglas avatar Aug 14 '24 15:08 dunglas

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.

francislavoie avatar Aug 14 '24 15:08 francislavoie

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 true. So, I'm not particularly attached to it one way or the other. I didn't think about being able to use the admin api to change settings, so I'm leaning towards closing the PR.

withinboredom avatar Aug 14 '24 15:08 withinboredom

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 command (there is wisdom in that, to keep it more predictable and symmetric), I would just flip the switch in a config file, personally.

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 avatar Aug 14 '24 16:08 mholt

@mholt in case you didn't realize, this command is more akin to caddy file-server or caddy reverse-proxy kinda thing

francislavoie avatar Aug 14 '24 16:08 francislavoie

Hayır itirazım yok

sf

14 Ağu 2024 Çar 01:40 tarihinde Rob Landers @.***> şunu yazdı:

@dunglas https://github.com/dunglas any objections to merging this?

— Reply to this email directly, view it on GitHub https://github.com/dunglas/frankenphp/pull/932#issuecomment-2288416292, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOVHCDRWYAKLIX5FNOQG4TZRMX3PAVCNFSM6AAAAABLLIKH6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBYGQYTMMRZGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Fun32secg32 avatar Aug 14 '24 17:08 Fun32secg32

That's true. In that case it doesn't really matter then IMO. Since those specialty sub commands carry config on them.

mholt avatar Aug 14 '24 17:08 mholt