Conversation
ebf1585 to
293f57f
Compare
|
This command is now good enough to run Composer and scripts built with Symfony Console! |
| os.Exit(status) | ||
|
|
||
| return status, nil |
There was a problem hiding this comment.
Hmm. This return will never be reached. I think returning will let Caddy call os.Exit anyway, so I don't think you need to do that yourself.
There was a problem hiding this comment.
This doesn't work (the returned status code is always 1 in case of error, even if set explicitly in PHP with exit).
There was a problem hiding this comment.
🤔 then that's possibly a bug in Caddy. Good to know.
There was a problem hiding this comment.
Opened caddyserver/caddy#5874 to fix that. The status code wasn't being carried through since we enabled Cobra
| if len(args) < 1 { | ||
| return 1, errors.New("the path to the PHP script is required") | ||
| } |
There was a problem hiding this comment.
Makes me think, is there value in making php-cli -i work for example? (Could be useful to check enabled features). Some people use php -a and php -l on occasion too. But 🤷♂️
There was a problem hiding this comment.
I think it would be great if ./frankenphp php <args> behaved identical to php <args> with php-cli installed.
There was a problem hiding this comment.
That would be nice, but it's a bit more work. The best option would be to allow the embedding of the official PHP SAPI (this requires a patch on PHP). I suggest merging this patch as is and trying to improve it later.
Co-authored-by: Francis Lavoie <[email protected]>
This patch allows FrankenPHP to execute CLI scripts. This is especially useful when using the static binary to run Composer, Symfony or Laravel commands.
Continuation of #4.