frankenphp.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _FRANKENPPHP_H
  2. #define _FRANKENPPHP_H
  3. #include <Zend/zend_types.h>
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #ifndef FRANKENPHP_VERSION
  7. #define FRANKENPHP_VERSION dev
  8. #endif
  9. #define STRINGIFY(x) #x
  10. #define TOSTRING(x) STRINGIFY(x)
  11. typedef struct go_string {
  12. size_t len;
  13. char *data;
  14. } go_string;
  15. typedef struct php_variable {
  16. const char *var;
  17. size_t data_len;
  18. char *data;
  19. } php_variable;
  20. typedef struct frankenphp_version {
  21. unsigned char major_version;
  22. unsigned char minor_version;
  23. unsigned char release_version;
  24. const char *extra_version;
  25. const char *version;
  26. unsigned long version_id;
  27. } frankenphp_version;
  28. frankenphp_version frankenphp_get_version();
  29. typedef struct frankenphp_config {
  30. frankenphp_version version;
  31. bool zts;
  32. bool zend_signals;
  33. bool zend_max_execution_timers;
  34. } frankenphp_config;
  35. frankenphp_config frankenphp_get_config();
  36. int frankenphp_init(int num_threads);
  37. int frankenphp_update_server_context(
  38. bool create, uintptr_t current_request, uintptr_t main_request,
  39. const char *request_method, char *query_string, zend_long content_length,
  40. char *path_translated, char *request_uri, const char *content_type,
  41. char *auth_user, char *auth_password, int proto_num);
  42. int frankenphp_request_startup();
  43. int frankenphp_execute_script(char *file_name);
  44. void frankenphp_register_bulk_variables(go_string known_variables[27],
  45. php_variable *dynamic_variables,
  46. size_t size, zval *track_vars_array);
  47. int frankenphp_execute_script_cli(char *script, int argc, char **argv);
  48. #endif