update for new compilation in php-src

This commit is contained in:
henderkes
2026-03-06 16:38:31 +07:00
parent 4726593abc
commit 9ca03588d4
3 changed files with 3 additions and 14 deletions

View File

@@ -35,7 +35,7 @@ func cmdPHPCLI(fs caddycmd.Flags) (int, error) {
}
}
status := frankenphp.ExecuteScriptCLI(args)
status := frankenphp.ExecuteScriptCLI(args[0], args)
os.Exit(status)

View File

@@ -36,9 +36,7 @@
#include <pthread_np.h>
#endif
#if PHP_VERSION_ID >= 80500
#include <sapi/cli/cli.h>
#else
#ifndef HAVE_EMBED_CLI
#include "emulate_php_cli.h"
#endif
@@ -1256,7 +1254,7 @@ static void *execute_script_cli(void *arg) {
volatile int v = PHP_VERSION_ID;
(void)v;
#if PHP_VERSION_ID >= 80500
#if HAVE_EMBED_CLI
return (void *)(intptr_t)do_php_cli(args->argc, args->argv);
#else
return (void *)(intptr_t)emulate_script_cli(args);

View File

@@ -750,15 +750,6 @@ func go_is_context_done(threadIndex C.uintptr_t) C.bool {
return C.bool(phpThreads[threadIndex].frankenPHPContext().isDone)
}
func ExecuteScriptCLI(args []string) int {
// Ensure extensions are registered before CLI execution
registerExtensions()
argc, argv := convertArgs(args)
defer freeArgs(argv)
return int(C.frankenphp_execute_script_cli(nil, argc, (**C.char)(unsafe.Pointer(&argv[0])), false))
}
func convertArgs(args []string) (C.int, []*C.char) {
argc := C.int(len(args))
argv := make([]*C.char, argc)