Skip to content
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 a directive for loading inifiles #1229

Open
jakubtobiasz opened this issue Dec 7, 2024 · 2 comments
Open

Add a directive for loading inifiles #1229

jakubtobiasz opened this issue Dec 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jakubtobiasz
Copy link

Describe you feature request

Is your feature request related to a problem? Please describe.
I have the following configuration:

{
	frankenphp
	order php_server before file_server
	log {
        level DEBUG
    }
}

:443 {
	tls /cert/_wildcard.orb.local.pem /cert/_wildcard.orb.local-key.pem

	root * {$PUBLIC_DIR:/app/public}

	@has_xdebug_cookie header Cookie *XDEBUG_SESSION*

	route @has_xdebug_cookie {
		php_server {
			env XDEBUG_MODE "debug" <---- it doesn't work here :(
		}
	}

	route {
		php_server 
	}
}

To improve performance while developing an app, I'd like to provide a conditional xdebug enabling. I've noticed the XDebug Helper sets the XDEBUG_SESSION cookie. So, I know when I should do something (enable XDebug). However, I've noticed the only way to provide an additional .ini file is by setting an environment variable, which is not possible for me. I'm not sure if it is possible, but it would be great if I could provide an extra .ini file as a directive instead of an environment variable.

Describe the solution you'd like
Something like:

...
	route @has_xdebug_cookie {
		php_server {
			ini "some_path_to_my.ini"
		}
	}
...

Describe alternatives you've considered
n/a

@jakubtobiasz jakubtobiasz added the enhancement New feature or request label Dec 7, 2024
@dunglas
Copy link
Owner

dunglas commented Dec 7, 2024

Good idea. We could even support setting INI directives directly in the Caddyfile.

@jakubtobiasz
Copy link
Author

Great to hear! 🥳 I can't wait to see the PR, as I was looking into the source of Franken, but it's magic for me (yet) ✨.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants