[php-src] PR #21354: [FrankenPHP] Make php-cli functionality available in embed build
| From: | henderkes | Date: | Fri, 06 Mar 2026 09:28:28 +0000 |
| Subject: | [php-src] PR #21354: [FrankenPHP] Make php-cli functionality available in embed build | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35104@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21354
Author: henderkes
Background: we've long wanted to include full php-cli functionality in frankenphp, but only
have a emulation of it with
frankenphp php-cli that only supports -r and direct
execution of files. Getting the full functionality would be beneficial, because it would allow using
frankenphp's go extensions in a cli context.
This PR:
- renames sapi/cli/php_cli.c::main() to ::do_php_cli()
- creates new guarded main() method that does nothing but call do_php_cli(), except
when compiling embed sapi
- because this creates different objects and could lead to conflicts with traditional cli build,
objects are redirected to sapi/embed/cli instead
- export do_php_cli() in sapi/cli.h and sapi/php_embed.h and
defines HAVE_EMBED_CLI for convenience (could remove, just makes things simpler in
frankenphp
Tested on Linux only so far. I copied the windows build script parts from sapi/cli as best as I
could, but haven't tested it just yet.
cc @alexandre-daubois @withinboredom