2021-09-24 18:52:20 +02:00
|
|
|
#ifndef _FRANKENPPHP_H
|
|
|
|
|
#define _FRANKENPPHP_H
|
|
|
|
|
|
2022-11-10 14:03:50 +01:00
|
|
|
#include <Zend/zend_types.h>
|
2023-12-01 17:26:21 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
2021-11-01 00:18:30 +01:00
|
|
|
|
2023-09-16 13:03:05 +02:00
|
|
|
#ifndef FRANKENPHP_VERSION
|
|
|
|
|
#define FRANKENPHP_VERSION dev
|
|
|
|
|
#endif
|
|
|
|
|
#define STRINGIFY(x) #x
|
|
|
|
|
#define TOSTRING(x) STRINGIFY(x)
|
|
|
|
|
|
2024-01-22 13:23:37 +01:00
|
|
|
typedef struct go_string {
|
|
|
|
|
size_t len;
|
2024-03-12 18:31:30 +01:00
|
|
|
char *data;
|
2024-01-22 13:23:37 +01:00
|
|
|
} go_string;
|
|
|
|
|
|
2025-01-08 08:23:23 +01:00
|
|
|
typedef struct ht_key_value_pair {
|
|
|
|
|
zend_string *key;
|
|
|
|
|
char *val;
|
|
|
|
|
size_t val_len;
|
|
|
|
|
} ht_key_value_pair;
|
|
|
|
|
|
2024-03-12 18:31:30 +01:00
|
|
|
typedef struct php_variable {
|
|
|
|
|
const char *var;
|
|
|
|
|
size_t data_len;
|
|
|
|
|
char *data;
|
|
|
|
|
} php_variable;
|
|
|
|
|
|
2023-03-05 15:47:20 +01:00
|
|
|
typedef struct frankenphp_version {
|
2023-12-01 17:26:21 +01:00
|
|
|
unsigned char major_version;
|
|
|
|
|
unsigned char minor_version;
|
|
|
|
|
unsigned char release_version;
|
|
|
|
|
const char *extra_version;
|
|
|
|
|
const char *version;
|
|
|
|
|
unsigned long version_id;
|
2023-03-05 15:47:20 +01:00
|
|
|
} frankenphp_version;
|
|
|
|
|
frankenphp_version frankenphp_get_version();
|
|
|
|
|
|
|
|
|
|
typedef struct frankenphp_config {
|
2023-12-01 17:26:21 +01:00
|
|
|
frankenphp_version version;
|
|
|
|
|
bool zts;
|
|
|
|
|
bool zend_signals;
|
|
|
|
|
bool zend_max_execution_timers;
|
2023-03-05 15:47:20 +01:00
|
|
|
} frankenphp_config;
|
|
|
|
|
frankenphp_config frankenphp_get_config();
|
2022-11-12 14:48:10 +01:00
|
|
|
|
2024-12-17 11:28:51 +01:00
|
|
|
int frankenphp_new_main_thread(int num_threads);
|
|
|
|
|
bool frankenphp_new_php_thread(uintptr_t thread_index);
|
2022-06-03 17:18:07 +02:00
|
|
|
|
2025-03-10 08:44:03 +01:00
|
|
|
bool frankenphp_shutdown_dummy_request(void);
|
|
|
|
|
int frankenphp_update_server_context(bool is_worker_request,
|
2023-12-01 17:26:21 +01:00
|
|
|
|
2025-03-10 08:44:03 +01:00
|
|
|
const char *request_method,
|
|
|
|
|
char *query_string,
|
|
|
|
|
zend_long content_length,
|
|
|
|
|
char *path_translated, char *request_uri,
|
|
|
|
|
const char *content_type, char *auth_user,
|
|
|
|
|
char *auth_password, int proto_num);
|
2022-05-18 11:52:24 +02:00
|
|
|
int frankenphp_request_startup();
|
2023-11-12 13:12:54 +01:00
|
|
|
int frankenphp_execute_script(char *file_name);
|
2021-09-24 18:52:20 +02:00
|
|
|
|
2025-05-01 02:06:31 +02:00
|
|
|
int frankenphp_execute_script_cli(char *script, int argc, char **argv,
|
|
|
|
|
bool eval);
|
2023-10-09 14:38:15 +02:00
|
|
|
|
2024-11-04 15:34:00 +01:00
|
|
|
void frankenphp_register_variables_from_request_info(
|
|
|
|
|
zval *track_vars_array, zend_string *content_type,
|
|
|
|
|
zend_string *path_translated, zend_string *query_string,
|
2025-01-08 08:23:23 +01:00
|
|
|
zend_string *auth_user, zend_string *request_method);
|
2024-11-04 15:34:00 +01:00
|
|
|
void frankenphp_register_variable_safe(char *key, char *var, size_t val_len,
|
|
|
|
|
zval *track_vars_array);
|
|
|
|
|
zend_string *frankenphp_init_persistent_string(const char *string, size_t len);
|
2024-11-17 19:19:53 +01:00
|
|
|
int frankenphp_reset_opcache(void);
|
2025-02-19 20:39:33 +01:00
|
|
|
int frankenphp_get_current_memory_limit();
|
2025-03-01 14:45:04 +01:00
|
|
|
void frankenphp_add_assoc_str_ex(zval *track_vars_array, char *key,
|
|
|
|
|
size_t keylen, zend_string *val);
|
2024-11-04 15:34:00 +01:00
|
|
|
|
2025-01-27 21:48:20 +01:00
|
|
|
void frankenphp_register_single(zend_string *z_key, char *value, size_t val_len,
|
|
|
|
|
zval *track_vars_array);
|
2025-01-08 08:23:23 +01:00
|
|
|
void frankenphp_register_bulk(
|
|
|
|
|
zval *track_vars_array, ht_key_value_pair remote_addr,
|
|
|
|
|
ht_key_value_pair remote_host, ht_key_value_pair remote_port,
|
|
|
|
|
ht_key_value_pair document_root, ht_key_value_pair path_info,
|
|
|
|
|
ht_key_value_pair php_self, ht_key_value_pair document_uri,
|
|
|
|
|
ht_key_value_pair script_filename, ht_key_value_pair script_name,
|
|
|
|
|
ht_key_value_pair https, ht_key_value_pair ssl_protocol,
|
|
|
|
|
ht_key_value_pair request_scheme, ht_key_value_pair server_name,
|
|
|
|
|
ht_key_value_pair server_port, ht_key_value_pair content_length,
|
|
|
|
|
ht_key_value_pair gateway_interface, ht_key_value_pair server_protocol,
|
|
|
|
|
ht_key_value_pair server_software, ht_key_value_pair http_host,
|
|
|
|
|
ht_key_value_pair auth_type, ht_key_value_pair remote_ident,
|
|
|
|
|
ht_key_value_pair request_uri);
|
|
|
|
|
|
2021-09-24 18:52:20 +02:00
|
|
|
#endif
|