static-php-cli icon indicating copy to clipboard operation
static-php-cli copied to clipboard

add --embed-app=/path/to/folder option (or similar) for frankenphp

Open henderkes opened this issue 4 months ago • 7 comments

or --build-frankenphp=/path/to/folder @crazywhalecc ?

henderkes avatar Sep 04 '25 10:09 henderkes

I prefer --{with|build}-embed-app=/path/to/c-app, --{with|build}-frankenphp-app=/path/to/folder, --{with|build}-micro-app=/path/to/phar-or-php. WDYT?

And I personally don't use them anyway just because I don't want to wait repeated builds when embedding failure.

crazywhalecc avatar Sep 05 '25 01:09 crazywhalecc

Yes, that's a good idea to keep it in line with php conventions.

henderkes avatar Sep 05 '25 03:09 henderkes

The micro and frankenphp ones are fairly straightforward, but I'm not sure about embedded c apps, as we wouldn't be able to guess how they have to be built.

henderkes avatar Sep 06 '25 02:09 henderkes

The micro and frankenphp ones are fairly straightforward, but I'm not sure about embedded c apps, as we wouldn't be able to guess how they have to be built.

Speaking of embed, I thought of a problem. If it is bin/spc-*-docker, these options are easy to be used incorrectly unless a relative path is used and it is in the source directory.

crazywhalecc avatar Sep 07 '25 03:09 crazywhalecc

Hmm, good catch. I don't think we can work around that, other than by copying the files/folder into the docker container before forwarding to bin/spc...

henderkes avatar Sep 07 '25 03:09 henderkes

Another way is to use env vars to do it. In that way we could parse them in bin/spc-*-docker shell script and convert to absolute path, and automatically mount, pass.

crazywhalecc avatar Sep 07 '25 05:09 crazywhalecc

For embed project, I don't have any idea and I think it's not appropriate to detect CMakeLists.txt or *.m4 by SPC. It fallbacks to our previous discussion.

crazywhalecc avatar Sep 07 '25 05:09 crazywhalecc