mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
update for new compilation in php-src
This commit is contained in:
@@ -35,7 +35,7 @@ func cmdPHPCLI(fs caddycmd.Flags) (int, error) {
|
||||
}
|
||||
}
|
||||
|
||||
status := frankenphp.ExecuteScriptCLI(args)
|
||||
status := frankenphp.ExecuteScriptCLI(args[0], args)
|
||||
|
||||
os.Exit(status)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user