41#ifdef HAVE_SYS_TYPES_H
46#include <sys/socket.h>
48#include <netinet/in.h>
51#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
55#define SAPI_LSAPI_MAX_HEADER_LENGTH LSAPI_RESP_HTTP_HEADER_MAX
70static int lsapi_mode = 0;
71static char *php_self =
"";
72static char *script_filename =
"";
73static int source_highlight = 0;
74static int ignore_php_ini = 0;
75static char * argv0 =
NULL;
77static int parse_user_ini = 0;
110#define INI_DEFAULT(name,value)\
111 ZVAL_STRING(tmp, value, 0);\
112 zend_hash_update(configuration_hash, name, sizeof(name), tmp, sizeof(zval), (void**)&entry);\
113 Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry))
115static void sapi_lsapi_ini_defaults(
HashTable *configuration_hash)
117#if PHP_MAJOR_VERSION > 4
134static size_t sapi_lsapi_ub_write(
const char *str,
size_t str_length)
139 ret = LSAPI_Write( str, str_length );
140 if (
ret < str_length ) {
142 return str_length -
ret;
146 while( remain > 0 ) {
147 ret = write( 1, str, remain );
150 return str_length - remain;
162static void sapi_lsapi_flush(
void * server_context)
165 if ( LSAPI_Flush() == -1) {
174static int sapi_lsapi_deactivate(
void)
176 if (
SG(request_info).path_translated ) {
177 efree(
SG(request_info).path_translated );
178 SG(request_info).path_translated =
NULL;
189static char *sapi_lsapi_getenv(
const char *
name,
size_t name_len )
192 return LSAPI_GetEnv(
name );
200static int add_variable(
const char * pKey,
int keyLen,
const char * pValue,
int valLen,
205 char * new_val = (
char *) pValue;
208 if (
sapi_module.input_filter(filter_arg, (
char *)pKey, &new_val, valLen, &new_val_len)) {
214static void litespeed_php_import_environment_variables(
zval *array_ptr)
217 char **env, *
p, *t =
buf;
218 size_t alloc_size =
sizeof(
buf);
225 zval_ptr_dtor_nogc(array_ptr);
232 zval_ptr_dtor_nogc(array_ptr);
244 if (nlen >= alloc_size) {
245 alloc_size = nlen + 64;
250 add_variable(t, nlen,
p + 1,
strlen(
p + 1 ), array_ptr);
259static void sapi_lsapi_register_variables(
zval *track_vars_array)
261 char * php_self =
"";
263 if ( (
SG(request_info).request_uri ) )
264 php_self = (
SG(request_info).request_uri );
266 litespeed_php_import_environment_variables(track_vars_array);
268 LSAPI_ForeachHeader( add_variable, track_vars_array );
269 LSAPI_ForeachEnv( add_variable, track_vars_array );
270 add_variable(
"PHP_SELF", 8, php_self,
strlen( php_self ), track_vars_array );
286static size_t sapi_lsapi_read_post(
char *
buffer,
size_t count_bytes)
289 ssize_t
rv = LSAPI_ReadReqBody(
buffer, (
unsigned long long)count_bytes);
290 return (
rv >= 0) ? (size_t)
rv : 0;
301static char *sapi_lsapi_read_cookies(
void)
319 {101,
"Switching Protocols"},
323 {203,
"Non-Authoritative Information"},
325 {205,
"Reset Content"},
326 {206,
"Partial Content"},
327 {300,
"Multiple Choices"},
328 {301,
"Moved Permanently"},
329 {302,
"Moved Temporarily"},
331 {304,
"Not Modified"},
333 {400,
"Bad Request"},
334 {401,
"Unauthorized"},
335 {402,
"Payment Required"},
338 {405,
"Method Not Allowed"},
339 {406,
"Not Acceptable"},
340 {407,
"Proxy Authentication Required"},
341 {408,
"Request Time-out"},
344 {411,
"Length Required"},
345 {412,
"Precondition Failed"},
346 {413,
"Request Entity Too Large"},
347 {414,
"Request-URI Too Large"},
348 {415,
"Unsupported Media Type"},
349 {428,
"Precondition Required"},
350 {429,
"Too Many Requests"},
351 {431,
"Request Header Fields Too Large"},
352 {451,
"Unavailable For Legal Reasons"},
353 {500,
"Internal Server Error"},
354 {501,
"Not Implemented"},
355 {502,
"Bad Gateway"},
356 {503,
"Service Unavailable"},
357 {504,
"Gateway Time-out"},
358 {505,
"HTTP Version not supported"},
359 {511,
"Network Authentication Required"},
369 bool ignore_status = 0;
370 int response_status =
SG(sapi_headers).http_response_code;
372 if (
SG(request_info).no_headers == 1) {
373 LSAPI_FinalizeRespHeaders();
384 if (
SG(sapi_headers).http_status_line &&
385 (
s =
strchr(
SG(sapi_headers).http_status_line,
' ')) != 0 &&
386 (
s -
SG(sapi_headers).http_status_line) >= 5 &&
387 strncasecmp(
SG(sapi_headers).http_status_line,
"HTTP/", 5) == 0
390 response_status = atoi((
s + 1));
405 while (
err->code != 0) {
420 LSAPI_AppendRespHeader(
buf,
len );
432 if (!ignore_status) {
436 }
else if (response_status == 304 && h->
header_len >
sizeof(
"Content-Type:")-1 &&
448 LSAPI_FinalizeRespHeaders();
455static int mod_lsapi_mode = 0;
464 if ( mod_lsapi_mode ) {
466 return sapi_lsapi_send_headers_like_cgi(sapi_headers);
480 if (
SG(sapi_headers).send_default_content_type) {
487 "Content-type: %s", hd );
490 LSAPI_AppendRespHeader( headerBuf,
len );
493 LSAPI_FinalizeRespHeaders();
502static void sapi_lsapi_log_message(
const char *message,
int syslog_type_int)
506 if ( *(message +
len - 1 ) !=
'\n' )
514 LSAPI_Write_Stderr( message,
len );
521static void log_message (
const char *fmt, ...)
528 sapi_lsapi_log_message(
buf
534#define DEBUG_MESSAGE(fmt, ...) log_message("LS:%d " fmt "\n", __LINE__, ##__VA_ARGS__)
536#define DEBUG_MESSAGE(fmt, ...)
539static int lsapi_activate_user_ini(
void);
541static int sapi_lsapi_activate(
void)
543 char *path, *server_name;
544 size_t path_len, server_name_len;
547 if (!
SG(request_info).path_translated) {
552 server_name = sapi_lsapi_getenv(
"SERVER_NAME", 0);
555 server_name_len =
strlen(server_name);
556 server_name =
estrndup(server_name, server_name_len);
565 path_len =
strlen(
SG(request_info).path_translated);
568 if (!
IS_SLASH(
SG(request_info).path_translated[path_len])) {
570 memcpy(path,
SG(request_info).path_translated, path_len + 1);
574 path =
estrndup(
SG(request_info).path_translated, path_len);
585 if (parse_user_ini && lsapi_activate_user_ini() ==
FAILURE) {
600 sapi_lsapi_deactivate,
610 sapi_lsapi_send_headers,
613 sapi_lsapi_read_post,
614 sapi_lsapi_read_cookies,
616 sapi_lsapi_register_variables,
617 sapi_lsapi_log_message,
626static void init_request_info(
void )
631 SG(request_info).content_type = pContentType ? pContentType :
"";
632 SG(request_info).request_method = LSAPI_GetRequestMethod();
633 SG(request_info).query_string = LSAPI_GetQueryString();
634 SG(request_info).request_uri = LSAPI_GetScriptName();
635 SG(request_info).content_length = LSAPI_GetReqBodyLen();
636 SG(request_info).path_translated =
estrdup( LSAPI_GetScriptFileName());
639 SG(sapi_headers).http_response_code = 200;
645static int lsapi_execute_script(
void)
660 memccpy(
p,
SG(request_info).path_translated +
len, 0, 46 );
668static void lsapi_sigsegv(
int signal )
674static int do_clean_shutdown = 1;
676static int clean_onexit = 1;
679static void lsapi_clean_shutdown(
void)
681 struct sigaction act;
683#if PHP_MAJOR_VERSION >= 7
687 sigemptyset(&act.sa_mask);
689 act.sa_handler = lsapi_sigsegv;
699 tmv.it_value.tv_sec = 0;
700 tmv.it_value.tv_usec = 100000;
703#if PHP_MAJOR_VERSION >= 7
707 zend_string_release(
key);
718static void lsapi_sigterm(
int signal)
724 lsapi_clean_shutdown();
729static void lsapi_atexit(
void)
734 lsapi_clean_shutdown();
740 struct sigaction act;
745 if (do_clean_shutdown) {
746 sigemptyset(&act.sa_mask);
747 act.sa_flags = SA_NODEFER;
748 act.sa_handler = lsapi_sigterm;
766 lsapi_execute_script();
779static int alter_ini(
const char * pKey,
int keyLen,
const char * pValue,
int valLen,
786 if (
'\001' == *pKey ) {
807 if (( keyLen == 7 )&&(
strncasecmp( pKey,
"engine", 6 )== 0 ))
809 if ( *pValue ==
'0' )
815 psKey = zend_string_init(pKey, keyLen, 1);
817 (
char *)pValue, valLen,
825static void user_config_cache_entry_dtor(
zval *el)
832static void user_config_cache_init(
void)
837static int pathlen_without_trailing_slash(
char *path)
848static inline char* skip_slash(
char *
s)
879static void walk_down_the_path(
char* path_start,
886 char *
pos = path_stop + pathlen_without_trailing_slash(path_start);
889 while ((
pos = skip_slash(
pos))[0]) {
918 if (!
PG(user_ini_filename) || !*
PG(user_ini_filename)) {
923 ctx->
path =
SG(request_info).path_translated;
928 ctx->
doc_root = sapi_lsapi_getenv(
"DOCUMENT_ROOT", 0);
932 rc = (*fn_next)(ctx, fn_next + 1);
951 rc = (*fn_next)(ctx, fn_next + 1);
970 ctx->
path = real_path;
977 rc = (*fn_next)(ctx, fn_next + 1);
991 ctx->
entry = zend_hash_str_find_ptr(&user_config_cache, ctx->
path, ctx->
path_len);
999 zend_hash_str_update_ptr(&user_config_cache, ctx->
path,
1004 return (*fn_next)(ctx, fn_next + 1);
1010static void walk_down_the_path_callback(
char*
begin,
1025 uint32_t docroot_len;
1032 ? pathlen_without_trailing_slash(ctx->
doc_root)
1035 int is_outside_of_docroot = !docroot_len ||
1039 if (is_outside_of_docroot) {
1044 &walk_down_the_path_callback, ctx);
1051 rc = (*fn_next)(ctx, fn_next + 1);
1067 rc = (*fn_next)(ctx, fn_next + 1);
1073static int lsapi_activate_user_ini(
void )
1086 &lsapi_activate_user_ini_basic_checks,
1087 &lsapi_activate_user_ini_mk_path,
1088 &lsapi_activate_user_ini_mk_realpath,
1089 &lsapi_activate_user_ini_mk_user_config,
1090 &lsapi_activate_user_ini_walk_down_the_path,
1091 &lsapi_activate_user_ini_finally,
1099static void override_ini(
void)
1102 LSAPI_ForeachSpecialEnv( alter_ini,
NULL );
1107static int processReq(
void)
1113 SG(server_context) = (
void *) 1;
1119 init_request_info();
1121 if ( lsapi_module_main( source_highlight ) == -1 ) {
1125 LSAPI_AppendRespHeader(
"status: 403", 11 );
1126 LSAPI_AppendRespHeader(
"content-type: text/html", 23 );
1127 LSAPI_Write(
"Forbidden: PHP engine is disable.\n", 34 );
1133static void cli_usage(
void)
1135 static const char *
usage =
1137 " php -[b|c|n|h|i|q|s|v|?] [<file>] [args...]\n"
1138 " Run in LSAPI mode, only '-b', '-s' and '-c' are effective\n"
1139 " Run in Command Line Interpreter mode when parameters are specified\n"
1141 " -b <address:port>|<port> Bind Path for external LSAPI Server mode\n"
1142 " -c <path>|<file> Look for php.ini file in this directory\n"
1143 " -n No php.ini file will be used\n"
1145 " -i PHP information\n"
1146 " -l Syntax check\n"
1147 " -q Quiet-mode. Suppress HTTP Header output.\n"
1148 " -s Display colour syntax highlighted source.\n"
1149 " -v Version number\n"
1152 " args... Arguments passed to script.\n";
1156#ifdef PHP_OUTPUT_NEWAPI
1159 php_end_ob_buffers(1);
1163static int parse_opt(
int argc,
char * argv[],
int *climode,
1164 char **php_ini_path,
char ** php_bind )
1166 char **
p = &argv[1];
1167 char ** argend= &argv[argc];
1169 while ((
p < argend )&&(**
p ==
'-' )) {
1174 if (
p >= argend ) {
1175 fprintf( stderr,
"TCP or socket address must be specified following '-b' option.\n");
1178 *php_bind = strdup(*
p++);
1182 if (
p >= argend ) {
1183 fprintf( stderr,
"<path> or <file> must be specified following '-c' option.\n");
1187 *php_ini_path = strdup( *
p++ );
1190 source_highlight = 1;
1196 if ( *((*(
p-1))+2) ==
's' )
1209 if (
p - argv < argc ) {
1215static int cli_main(
int argc,
char * argv[] )
1218 static const char * ini_defaults[] = {
1219 "display_errors",
"1",
1220 "register_argc_argv",
"1",
1222 "implicit_flush",
"1",
1223 "output_buffering",
"0",
1224 "max_execution_time",
"0",
1225 "max_input_time",
"-1",
1230 char **
p = &argv[1];
1231 char ** argend= &argv[argc];
1238 SG(server_context) = (
void *) 1;
1241 CG(in_compilation) = 0;
1244#if PHP_MAJOR_VERSION < 7
1245 EG(uninitialized_zval_ptr) =
NULL;
1247 for(
ini = ini_defaults; *
ini;
ini+=2 ) {
1255 while ((
p < argend )&&(**
p ==
'-' )) {
1264#ifdef PHP_OUTPUT_NEWAPI
1267 php_end_ob_buffers(1);
1276#ifdef PHP_OUTPUT_NEWAPI
1279 php_end_ob_buffers(1);
1291 source_highlight = 2;
1309 script_filename = *
p;
1312 SG(request_info).path_translated =
estrdup(*
p);
1313 SG(request_info).argc = argc - (
p - argv);
1314 SG(request_info).argv =
p;
1320 if (source_highlight == 1) {
1325 }
else if (source_highlight == 2) {
1340 ret =
EG(exit_status);
1346 fprintf(stderr,
"Could not open input file: %s.\n", *
p);
1372 struct sigaction act, old_term, old_quit, old_int, old_usr1;
1381 sigemptyset(&act.sa_mask);
1384 if( sigaction(
SIGTERM, &act, &old_term ) ||
1385 sigaction(
SIGINT, &act, &old_int ) ||
1386 sigaction(
SIGUSR1, &act, &old_usr1 ) ||
1387 sigaction(
SIGQUIT, &act, &old_quit )) {
1388 perror(
"Can't set signals" );
1393 while((!s_stop )&&(
running < children )) {
1399 sigaction(
SIGTERM, &old_term, 0 );
1400 sigaction(
SIGQUIT, &old_quit, 0 );
1401 sigaction(
SIGINT, &old_int, 0 );
1402 sigaction(
SIGUSR1, &old_usr1, 0 );
1405 perror(
"php (pre-forking)" );
1427 argv0 = argv[0] +
strlen( argv[0] );
1429 while((
p > argv[0] )&&(
p[-1] !=
'/'))
1434 memset( argv[0] + ( argv0 -
p ), 0,
p - argv[0] );
1435 argv0 = argv[0] + (argv0 -
p);
1437 for( i = 1; i < argc; ++i )
1449 char * php_ini_path =
NULL;
1450 char * php_bind =
NULL;
1453 struct timeval tv_req_begin;
1454 struct timeval tv_req_end;
1455 int slow_script_msec = 0;
1459#if defined(SIGPIPE) && defined(SIG_IGN)
1467#if PHP_MAJOR_VERSION >= 7
1468#if defined(ZEND_SIGNALS) || PHP_MINOR_VERSION > 0
1474 if ( parse_opt( argc, argv, &climode,
1475 &php_ini_path, &php_bind ) == -1 ) {
1480 lsapi_sapi_module.phpinfo_as_text = 1;
1493 SG(request_info).path_translated =
NULL;
1496 lsapi_sapi_module.executable_location = argv[0];
1501 init_sapi_from_env(&lsapi_sapi_module);
1503 if ( ignore_php_ini )
1504 lsapi_sapi_module.php_ini_ignore = 1;
1506 if ( php_ini_path ) {
1507 lsapi_sapi_module.php_ini_path_override = php_ini_path;
1511 lsapi_sapi_module.ini_defaults = sapi_lsapi_ini_defaults;
1521 return cli_main(argc, argv);
1526 if ( bindFd == -1 ) {
1528 "Failed to bind socket [%s]: %s\n", php_bind, strerror(
errno ) );
1531 if ( bindFd != 0 ) {
1539#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
1556 if (do_clean_shutdown)
1557 atexit(lsapi_atexit);
1560#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
1561 if (is_criu && !
result) {
1565 if ( slow_script_msec ) {
1569 if ( slow_script_msec ) {
1571 n = ((long) tv_req_end.tv_sec - tv_req_begin.tv_sec ) * 1000
1572 + (tv_req_end.tv_usec - tv_req_begin.tv_usec) / 1000;
1573 if (
n > slow_script_msec )
1576 fprintf( stderr,
"[%s] Slow PHP script: %d ms\n URL: %s %s\n Query String: %s\n Script: %s\n",
1577 time_buf,
n, LSAPI_GetRequestMethod(),
1578 LSAPI_GetScriptName(), LSAPI_GetQueryString(),
1579 LSAPI_GetScriptFileName() );
1603 user_config_cache_init();
1605 const char *
p =
getenv(
"LSPHP_ENABLE_USER_INI");
1609 p =
getenv(
"LSAPI_CLEAN_SHUTDOWN");
1612 do_clean_shutdown = 1;
1614 do_clean_shutdown = 0;
1620 mod_lsapi_mode = (
getenv(
"LSAPI_DISABLE_CPAN_BEHAV") !=
NULL );
1648static int add_associate_array(
const char * pKey,
int keyLen,
const char * pValue,
int valLen,
1665 LSAPI_ForeachOrgHeader( add_associate_array,
return_value );
1684 if (!&
SG(sapi_headers).headers) {
1696 while(
len > 0 && (isspace( headerBuf[
len-1])) ) {
1701 while( isspace(*++
p));
1716 static const char * mod_names[] =
1718 "mod_rewrite",
"mod_mime",
"mod_headers",
"mod_expires",
"mod_auth_basic",
NULL
1720 const char **
name = mod_names;
1746 if (LSAPI_End_Response() != -1) {
SAPI_API double sapi_get_request_time(void)
SAPI_API char * sapi_get_default_content_type(void)
SAPI_API sapi_module_struct sapi_module
sapi_globals_struct sapi_globals
SAPI_API void sapi_startup(sapi_module_struct *sf)
#define SAPI_OPTION_NO_CHDIR
struct _sapi_globals_struct sapi_globals_struct
#define SAPI_HEADER_SENT_SUCCESSFULLY
#define STANDARD_SAPI_MODULE_PROPERTIES
struct _sapi_module_struct sapi_module_struct
ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini)
show_source(string $filename, bool $return=false)
fprintf($stream, string $format, mixed ... $values)
getenv(?string $name=null, bool $local_only=false)
http_response_code(int $response_code=0)
gettimeofday(bool $as_float=false)
strchr(string $haystack, string $needle, bool $before_needle=false)
struct _user_config_cache_entry user_config_cache_entry
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
PHPAPI bool php_header(void)
PHPAPI ZEND_COLD void php_print_info(int flag)
struct _user_config_cache_entry user_config_cache_entry
#define DEBUG_MESSAGE(fmt,...)
struct _http_error http_error
void start_children(int children)
#define SAPI_LSAPI_MAX_HEADER_LENGTH
void setArgv0(int argc, char *argv[])
void litespeed_cleanup(int signal)
zend_module_entry litespeed_module_entry
int(* fn_activate_user_ini_chain_t)(_lsapi_activate_user_ini_ctx *ctx, void *next)
litespeed_request_headers()
litespeed_response_headers()
litespeed_finish_request()
#define LSAPI_RESP_HTTP_HEADER_MAX
int LSAPI_Init_Env_Parameters(fn_select_t fp)
void LSAPI_No_Check_ppid(void)
int LSAPI_Prefork_Accept_r(LSAPI_Request *pReq)
int LSAPI_CreateListenSock(const char *pBind, int backlog)
int LSAPI_Get_Slow_Req_Msecs(void)
void LSCRIU_inc_req_processed()
PHPAPI zend_result php_lint_script(zend_file_handle *file)
PHPAPI size_t php_printf(const char *format,...)
void php_request_shutdown(void *dummy)
zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module)
PHPAPI void php_handle_aborted_connection(void)
php_core_globals core_globals
PHPAPI bool php_execute_script(zend_file_handle *primary_file)
void php_module_shutdown(void)
PHPAPI void php_print_version(sapi_module_struct *sapi_module)
zend_result php_request_startup(void)
PHPAPI int php_handle_auth_data(const char *auth)
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
PHPAPI void php_output_end_all(void)
PHPAPI int php_output_activate(void)
PHPAPI void php_output_startup(void)
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
strftime(string $format, ?int $timestamp=null)
localtime(?int $timestamp=null, bool $associative=false)
unsigned const char * end
unsigned const char * pos
struct _php_core_globals php_core_globals
#define TRACK_VARS_SERVER
PHPAPI void config_zval_dtor(zval *zvalue)
PHPAPI int php_parse_user_ini_file(const char *dirname, const char *ini_filename, HashTable *target_hash)
PHPAPI int php_ini_has_per_host_config(void)
PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage)
PHPAPI int php_ini_has_per_dir_config(void)
PHPAPI void php_ini_activate_per_host_config(const char *host, size_t host_len)
PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
#define PHP_INI_STAGE_ACTIVATE
#define PHP_INI_STAGE_RUNTIME
#define PHP_INI_STAGE_SHUTDOWN
#define PHP_INI_STAGE_HTACCESS
PHP_JSON_API size_t int options
php_output_handler * running
unsigned char key[REFLECTION_KEY_LEN]
PHPAPI void(* php_import_environment_variables)(zval *array_ptr)
PHPAPI void php_register_variable(const char *var, const char *strval, zval *track_vars_array)
PHPAPI void php_register_variable_safe(const char *var, const char *strval, size_t str_len, zval *track_vars_array)
#define PHP_MINOR_VERSION
#define PHP_MAJOR_VERSION
user_config_cache_entry * entry
zend_string * opened_path
union _zend_file_handle::@045057025306333206016200356074063117305134322373 handle
PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
ZEND_API zend_utility_values zend_uv
ZEND_API size_t(* zend_printf)(const char *format,...)
ZEND_API void add_assoc_string_ex(zval *arg, const char *key, size_t key_len, const char *str)
ZEND_API zend_result add_next_index_string(zval *arg, const char *str)
#define zend_parse_parameters_none()
#define estrndup(s, length)
#define pemalloc(size, persistent)
#define erealloc(ptr, size)
strncmp(string $string1, string $string2, int $length)
exit(string|int $status=0)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API zend_executor_globals executor_globals
ZEND_API zend_compiler_globals compiler_globals
ZEND_API size_t zend_dirname(char *path, size_t len)
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
#define strncasecmp(s1, s2, n)
#define strcasecmp(s1, s2)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
struct _zend_executor_globals zend_executor_globals
struct _zend_compiler_globals zend_compiler_globals
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
ZEND_API zend_result highlight_file(const char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
zend_syntax_highlighter_ini syntax_highlighter_ini
struct _zend_syntax_highlighter_ini zend_syntax_highlighter_ini
ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage)
ZEND_API zend_result zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage)
ZEND_API zend_result zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change)
struct _zend_file_handle zend_file_handle
ZEND_API void * zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos)
ZEND_API void * zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos)
zend_llist_element * zend_llist_position
struct _zend_string zend_string
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
ZEND_API void ZEND_FASTCALL zend_str_tolower(char *str, size_t length)
#define zend_signal_startup()
ZEND_API void zend_stream_init_fp(zend_file_handle *handle, FILE *fp, const char *filename)
ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *filename)
#define ZSTR_INIT_LITERAL(s, persistent)
struct _zend_array HashTable
CWD_API char * tsrm_realpath(const char *path, char *real_path)
#define VCWD_FOPEN(path, mode)
#define IS_ABSOLUTE_PATH(path, len)