21#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
95PHPAPI size_t core_globals_offset;
98#define SAFE_FILENAME(f) ((f)?(f):"-")
113 spprintf(&version_info, 0,
"PHP %s (%s) (built: %s %s) (%s)\nCopyright (c) The PHP Group\n%s%s",
120#ifdef PHP_BUILD_COMPILER
121 " " PHP_BUILD_COMPILER
133#ifdef PHP_BUILD_PROVIDER
134 "Built by " PHP_BUILD_PROVIDER
"\n"
183 PG(syslog_facility) = LOG_FTP;
205#ifdef LOG_INTERNAL_MARK
207 PG(syslog_facility) = LOG_INTERNAL_MARK;
306 PG(serialize_precision) = i;
365static void php_disable_classes(
void)
369 if (!*(
INI_STR(
"disable_classes"))) {
373 e =
PG(disable_classes) = strdup(
INI_STR(
"disable_classes"));
400static void php_binary_init(
void)
402 char *binary_location =
NULL;
405 if (GetModuleFileName(0, binary_location,
MAXPATHLEN) == 0) {
406 pefree(binary_location, 1);
407 binary_location =
NULL;
413 char *envpath, *path;
435 pefree(binary_location, 1);
436 binary_location =
NULL;
439 pefree(binary_location, 1);
440 binary_location =
NULL;
444 PG(php_binary) = binary_location;
507 PG(display_errors) = php_get_display_errors_mode(new_value);
521 temporary_value = (ini_entry->orig_value ? ini_entry->orig_value :
NULL );
522 }
else if (ini_entry->value) {
523 temporary_value = ini_entry->value;
525 temporary_value =
NULL;
528 mode = php_get_display_errors_mode(temporary_value);
560 }
else if (
SG(default_charset) &&
SG(default_charset)[0]) {
561 return SG(default_charset);
567 if (
PG(input_encoding) &&
PG(input_encoding)[0]) {
568 return PG(input_encoding);
569 }
else if (
SG(default_charset) &&
SG(default_charset)[0]) {
570 return SG(default_charset);
576 if (
PG(output_encoding) &&
PG(output_encoding)[0]) {
577 return PG(output_encoding);
578 }
else if (
SG(default_charset) &&
SG(default_charset)[0]) {
579 return SG(default_charset);
593 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
613 return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
620 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
636 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
652 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
675 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
689 OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
723#if defined(PHP_WIN32)
724# define DEFAULT_SENDMAIL_PATH NULL
726# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t -i"
832static
bool module_initialized = false;
833static
bool module_startup = true;
834static
bool module_shutdown = false;
839 return module_startup;
846 return module_shutdown;
853 return module_initialized;
863 if (
PG(in_error_log)) {
867 PG(in_error_log) = 1;
875 php_syslog(syslog_type_int,
"%s", log_message);
876 PG(in_error_log) = 0;
881 error_log_mode = 0644;
883 if (
PG(error_log_mode) > 0 &&
PG(error_log_mode) <= 0777) {
884 error_log_mode =
PG(error_log_mode);
913 zend_string_free(error_time_str);
915 PG(in_error_log) = 0;
923 sapi_module.log_message(log_message, syslog_type_int);
925 PG(in_error_log) = 0;
945 va_start(
args, format);
963 va_start(
args, format);
995 char *docref_buf =
NULL, *target =
NULL;
996 char *docref_target =
"", *docref_root =
"";
998 const char *space =
"";
999 const char *class_name =
"";
1004 int is_function = 0;
1009 if (
PG(html_errors)) {
1011 zend_string_free(
buffer);
1013 if (replace_buffer) {
1025 }
else if (
PG(during_request_startup)) {
1027 }
else if (
EG(current_execute_data) &&
1028 EG(current_execute_data)->
func &&
1030 EG(current_execute_data)->opline &&
1033 switch (
EG(current_execute_data)->opline->extended_value) {
1068 origin_len = (int)
spprintf(&origin, 0,
"%s%s%s(%s)", class_name, space,
function, params);
1073 if (
PG(html_errors)) {
1074 replace_origin = escape_html(origin, origin_len);
1080 if (docref && docref[0] ==
'#') {
1081 docref_target =
strchr(docref,
'#');
1086 if (!docref && is_function) {
1091 if (space[0] ==
'\0') {
1100 docref = docref_buf;
1107 if (docref && is_function &&
PG(html_errors) &&
strlen(
PG(docref_root))) {
1108 if (
strncmp(docref,
"http://", 7)) {
1113 docref_root =
PG(docref_root);
1125 docref_target = target;
1130 if (
PG(docref_ext) &&
strlen(
PG(docref_ext))) {
1131 spprintf(&docref_buf, 0,
"%s%s", ref,
PG(docref_ext));
1134 docref = docref_buf;
1137 if (
PG(html_errors)) {
1148 if (replace_origin) {
1149 zend_string_free(replace_origin);
1157 zend_string_free(
buffer);
1160 zend_string_release(message);
1166#define php_error_docref_impl(docref, type, format) do {\
1168 va_start(args, format); \
1169 php_verror(docref, "", type, format, args); \
1190 va_start(
args, format);
1203 spprintf(¶ms, 0,
"%s,%s", param1, param2);
1204 va_start(
args, format);
1220 buf[buf_len - 1] =
'\0';
1221 buf[buf_len - 2] =
'\0';
1241static void clear_last_error(
void) {
1242 if (
PG(last_error_message)) {
1243 zend_string_release(
PG(last_error_message));
1244 PG(last_error_message) =
NULL;
1246 if (
PG(last_error_file)) {
1247 zend_string_release(
PG(last_error_file));
1248 PG(last_error_file) =
NULL;
1254static void report_zend_debug_error_notify_cb(
int type,
zend_string *error_filename, uint32_t error_lineno,
zend_string *message)
1256 if (
PG(report_zend_debug)) {
1285 if (
PG(ignore_repeated_errors) &&
PG(last_error_message)) {
1288 if (!zend_string_equals(
PG(last_error_message), message)
1289 || (!
PG(ignore_repeated_source)
1290 && ((
PG(last_error_lineno) != (
int)error_lineno)
1291 || !zend_string_equals(
PG(last_error_file), error_filename)))) {
1325 if (!error_filename) {
1326 error_filename =
ZSTR_KNOWN(ZEND_STR_UNKNOWN_CAPITALIZED);
1328 PG(last_error_type) =
type;
1329 PG(last_error_message) = zend_string_copy(message);
1330 PG(last_error_file) = zend_string_copy(error_filename);
1331 PG(last_error_lineno) = error_lineno;
1340 && (
PG(log_errors) ||
PG(display_errors) || (!module_initialized))) {
1341 char *error_type_str;
1349 error_type_str =
"Fatal error";
1353 error_type_str =
"Recoverable fatal error";
1360 error_type_str =
"Warning";
1364 error_type_str =
"Parse error";
1369 error_type_str =
"Notice";
1374 error_type_str =
"Deprecated";
1378 error_type_str =
"Unknown error";
1383 || (!module_initialized && (!
PG(display_startup_errors) || !
PG(display_errors)))) {
1390 spprintf(&log_buffer, 0,
"PHP %s: %s in %s on line %" PRIu32, error_type_str,
ZSTR_VAL(message),
ZSTR_VAL(error_filename), error_lineno);
1395 if (
PG(display_errors) && ((module_initialized && !
PG(during_request_startup)) || (
PG(display_startup_errors)))) {
1396 if (
PG(xmlrpc_errors)) {
1397 php_printf(
"<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>" ZEND_LONG_FMT "</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %" PRIu32
"</string></value></member></struct></value></fault></methodResponse>",
PG(xmlrpc_error_number), error_type_str,
ZSTR_VAL(message),
ZSTR_VAL(error_filename), error_lineno);
1399 char *prepend_string =
INI_STR(
"error_prepend_string");
1400 char *append_string =
INI_STR(
"error_append_string");
1402 if (
PG(html_errors)) {
1406 zend_string_free(
buf);
1415 fprintf(stderr,
"%s: ", error_type_str);
1417 fprintf(stderr,
" in %s on line %" PRIu32
"\n",
ZSTR_VAL(error_filename), error_lineno);
1432 if(!module_initialized) {
1442 EG(exit_status) = 255;
1443 if (module_initialized) {
1444 if (!
PG(display_errors) &&
1450 ctr.
line =
"HTTP/1.0 500 Internal Server Error";
1451 ctr.
line_len =
sizeof(
"HTTP/1.0 500 Internal Server Error") - 1;
1481 if (
SG(request_info).current_user) {
1482 return SG(request_info).current_user;
1503 SG(request_info).current_user_length =
len;
1506 return SG(request_info).current_user;
1509#if defined(ZTS) && defined(HAVE_GETPWUID_R) && defined(_SC_GETPW_R_SIZE_MAX)
1511 struct passwd *retpwptr =
NULL;
1512 int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
1526 err = getpwuid_r(pstat->st_uid, &_pw, pwbuf, pwbuflen, &retpwptr);
1528 if (
err == ERANGE) {
1536 if (retpwptr ==
NULL) {
1542 if ((pwd=getpwuid(pstat->st_uid))==
NULL) {
1546 SG(request_info).current_user_length =
strlen(pwd->pw_name);
1547 SG(request_info).current_user =
estrndup(pwd->pw_name,
SG(request_info).current_user_length);
1548#if defined(ZTS) && defined(HAVE_GETPWUID_R) && defined(_SC_GETPW_R_SIZE_MAX)
1551 return SG(request_info).current_user;
1561 char *new_timeout_str;
1562 size_t new_timeout_strlen;
1578 efree(new_timeout_str);
1585 *opened_path = filename;
1590static void php_zend_stream_closer(
void *
handle)
1596static size_t php_zend_stream_fsizer(
void *
handle)
1608 return ssb.
sb.st_size;
1627 opened_path = filename =
handle->filename;
1632 handle->filename = filename;
1633 handle->opened_path = opened_path;
1634 handle->handle.stream.handle = stream;
1636 handle->handle.stream.fsizer = php_zend_stream_fsizer;
1637 handle->handle.stream.isatty = 0;
1638 handle->handle.stream.closer = php_zend_stream_closer;
1664static void php_free_request_globals(
void)
1667 if (
PG(php_sys_temp_dir)) {
1669 PG(php_sys_temp_dir) =
NULL;
1672 EG(filename_override) =
NULL;
1673 EG(lineno_override) = -1;
1703 char memory_leak_buf[1024];
1710 char relay_buf[512];
1713 strlcat(memory_leak_buf, relay_buf,
sizeof(memory_leak_buf));
1716 unsigned long leak_count = (uintptr_t)
data;
1718 snprintf(memory_leak_buf, 512,
"Last leak repeated %lu time%s\n", leak_count, (leak_count>1?
"s":
""));
1720# if defined(PHP_WIN32)
1721 if (IsDebuggerPresent()) {
1722 OutputDebugString(memory_leak_buf);
1724 fprintf(stderr,
"%s", memory_leak_buf);
1727 fprintf(stderr,
"%s", memory_leak_buf);
1735 char memory_leak_buf[512];
1737 snprintf(memory_leak_buf, 512,
"=== Total %d memory leaks detected ===\n", *((uint32_t *)
data));
1738# if defined(PHP_WIN32)
1739 if (IsDebuggerPresent()) {
1740 OutputDebugString(memory_leak_buf);
1742 fprintf(stderr,
"%s", memory_leak_buf);
1745 fprintf(stderr,
"%s", memory_leak_buf);
1751 struct tm *ta, tmbuf;
1753 char *datetime_str, asctimebuf[52];
1754 char memory_leak_buf[4096];
1760 datetime_str[
strlen(datetime_str)-1]=0;
1761 snprintf(memory_leak_buf,
sizeof(memory_leak_buf),
"[%s] Script: '%s'\n", datetime_str,
SAFE_FILENAME(
SG(request_info).path_translated));
1763 snprintf(memory_leak_buf,
sizeof(memory_leak_buf),
"[null] Script: '%s'\n",
SAFE_FILENAME(
SG(request_info).path_translated));
1765# if defined(PHP_WIN32)
1766 if (IsDebuggerPresent()) {
1767 OutputDebugString(memory_leak_buf);
1769 fprintf(stderr,
"%s", memory_leak_buf);
1772 fprintf(stderr,
"%s", memory_leak_buf);
1788static void sigchld_handler(
int apar)
1790 int errno_save =
errno;
1793 signal(
SIGCHLD, sigchld_handler);
1813 _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
1815 PG(com_initialized) = 0;
1819 signal(
SIGCHLD, sigchld_handler);
1823 PG(in_error_log) = 0;
1824 PG(during_request_startup) = 1;
1829 PG(modules_activated) = 0;
1830 PG(header_is_being_sent) = 0;
1832 PG(in_user_include) = 0;
1841 if (
PG(max_input_time) == -1) {
1848 if (
PG(open_basedir) && *
PG(open_basedir)) {
1849 CWDG(realpath_cache_size_limit) = 0;
1862 }
else if (
PG(output_buffering)) {
1864 }
else if (
PG(implicit_flush)) {
1873 PG(modules_activated)=1;
1878 SG(sapi_started) = 1;
1887 bool report_memleaks;
1891 report_memleaks =
PG(report_memleaks);
1896 EG(current_execute_data) =
NULL;
1906 if (
PG(modules_activated)) {
1926 if (
PG(modules_activated)) {
1936 if (
PG(modules_activated)) {
1953 php_free_request_globals();
1976 zend_arena_destroy(
CG(
arena));
1992 if (
PG(com_initialized)) {
1994 PG(com_initialized) = 0;
2008 if (!
PG(com_initialized)) {
2009 if (CoInitialize(
NULL) == S_OK) {
2010 PG(com_initialized) = 1;
2070static _invalid_parameter_handler old_invalid_parameter_handler;
2072void dummy_invalid_parameter_handler(
2073 const wchar_t *expression,
2075 const wchar_t *
file,
2077 uintptr_t pReserved)
2079 static int called = 0;
2084 if(
PG(windows_show_crt_warning)) {
2090 len = _snprintf(
buf,
sizeof(
buf)-1,
"Invalid parameter detected in CRT function '%ws'",
function);
2093 len = _snprintf(
buf,
sizeof(
buf)-1,
"Invalid CRT parameter detected (function not known)");
2108 int module_number = 0;
2112 WORD wVersionRequested = MAKEWORD(2, 2);
2115 old_invalid_parameter_handler =
2116 _set_invalid_parameter_handler(dummy_invalid_parameter_handler);
2117 if (old_invalid_parameter_handler !=
NULL) {
2118 _set_invalid_parameter_handler(old_invalid_parameter_handler);
2122 _CrtSetReportMode(_CRT_ASSERT, 0);
2123 _CrtSetReportMode(_CRT_ERROR, 0);
2127 (
void)ts_resource(0);
2131 if (!php_win32_init_random_bytes()) {
2132 fprintf(stderr,
"\ncrypt algorithm provider initialization failed\n");
2137 module_shutdown =
false;
2138 module_startup =
true;
2142 if (module_initialized) {
2151 ts_allocate_fast_id(&core_globals_id, &core_globals_offset,
sizeof(
php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
2198 if (WSAStartup(wVersionRequested, &wsaData) != 0) {
2199 fprintf(stderr,
"\nwinsock.dll unusable. %d\n", WSAGetLastError());
2203 if (
UNEXPECTED(HIBYTE(wsaData.wVersion) != 2)) {
2204 fprintf(stderr,
"\nversion not found in winsock.dll. %d\n", WSAGetLastError());
2214 register_main_symbols(module_number);
2246 if (
PG(open_basedir) && *
PG(open_basedir)) {
2247 CWDG(realpath_cache_size_limit) = 0;
2250 PG(have_called_openlog) = 0;
2256 fprintf(stderr,
"PHP: Unable to initialize stream url wrappers.\n");
2270 fprintf(stderr,
"Unable to start builtin modules\n");
2296 if ((module = zend_hash_str_find_ptr(&
module_registry,
"standard",
sizeof(
"standard")-1)) !=
NULL) {
2297 EG(current_module) =
module;
2299 EG(current_module) =
NULL;
2305 php_disable_classes();
2308 if ((module = zend_hash_str_find_ptr(&
module_registry,
"core",
sizeof(
"core")-1)) !=
NULL) {
2309 module->version = PHP_VERSION;
2310 module->info_func = PHP_MINFO(php_core);
2322 module_initialized =
true;
2334 const char *directives[18];
2338 "Directive '%s' is deprecated",
2340 "allow_url_include",
2346 "Directive '%s' is no longer available in PHP",
2348 "allow_call_time_pass_reference",
2350 "define_syslog_variables",
2353 "magic_quotes_runtime",
2354 "magic_quotes_sybase",
2356 "register_long_arrays",
2359 "safe_mode_include_dir",
2360 "safe_mode_exec_dir",
2361 "safe_mode_allowed_env_vars",
2362 "safe_mode_protected_env_vars",
2363 "zend.ze1_compatibility_mode",
2374 for (i = 0; i < 2; i++) {
2375 const char **
p = directives[i].directives;
2395 module_startup =
false;
2426 int module_number=0;
2428 module_shutdown =
true;
2430 if (!module_initialized) {
2441 (
void)php_win32_shutdown_random_bytes();
2483 module_initialized =
false;
2489 ts_free_id(core_globals_id);
2493 if (old_invalid_parameter_handler ==
NULL) {
2494 _set_invalid_parameter_handler(old_invalid_parameter_handler);
2506#ifdef HAVE_BROKEN_GETCWD
2507 volatile int old_cwd_fd = -1;
2514#ifndef HAVE_BROKEN_GETCWD
2515# define OLD_CWD_SIZE 4096
2529 PG(during_request_startup) = 0;
2532#ifdef HAVE_BROKEN_GETCWD
2534 old_cwd_fd = open(
".", 0);
2555 if (
PG(auto_prepend_file) &&
PG(auto_prepend_file)[0]) {
2557 prepend_file_p = &prepend_file;
2560 if (
PG(auto_append_file) &&
PG(auto_append_file)[0]) {
2562 append_file_p = &append_file;
2564 if (
PG(max_input_time) != -1) {
2571 if (prepend_file_p &&
result) {
2577 if (append_file_p &&
result) {
2584 if (prepend_file_p) {
2588 if (append_file_p) {
2598#ifdef HAVE_BROKEN_GETCWD
2599 if (old_cwd_fd != -1) {
2604 if (old_cwd[0] !=
'\0') {
2625 EG(exit_status) = 0;
2626#define OLD_CWD_SIZE 4096
2637 PG(during_request_startup) = 0;
2646 if (old_cwd[0] !=
'\0') {
2651 return EG(exit_status);
2672 size_t auth_len = auth !=
NULL ?
strlen(auth) : 0;
2674 if (auth && auth_len > 0 &&
zend_binary_strncasecmp(auth, auth_len,
"Basic ",
sizeof(
"Basic ")-1,
sizeof(
"Basic ")-1) == 0) {
2678 user = php_base64_decode((
const unsigned char*)auth + 6, auth_len - 6);
2689 zend_string_free(user);
2694 SG(request_info).auth_user =
SG(request_info).auth_password =
NULL;
2696 SG(request_info).auth_digest =
NULL;
2699 if (
ret == -1 && auth && auth_len > 0 &&
zend_binary_strncasecmp(auth, auth_len,
"Digest ",
sizeof(
"Digest ")-1,
sizeof(
"Digest ")-1) == 0) {
2700 SG(request_info).auth_digest =
estrdup(auth + 7);
2705 SG(request_info).auth_digest =
NULL;
2737PHPAPI void php_reserve_tsrm_memory(
void)
2746 TSRM_ALIGNED_SIZE(
sizeof(zend_signal_globals_t)) +
2748 TSRM_ALIGNED_SIZE(zend_mm_globals_size()) +
2749 TSRM_ALIGNED_SIZE(zend_gc_globals_size()) +
2756PHPAPI bool php_tsrm_startup_ex(
int expected_threads)
2758 bool ret = tsrm_startup(expected_threads, 1, 0,
NULL);
2759 php_reserve_tsrm_memory();
2760 (
void)ts_resource(0);
2765PHPAPI bool php_tsrm_startup(
void)
2767 return php_tsrm_startup_ex(1);
SAPI_API zend_stat_t * sapi_get_stat(void)
SAPI_API sapi_module_struct sapi_module
SAPI_API void sapi_initialize_empty_request(void)
SAPI_API int sapi_flush(void)
SAPI_API char * sapi_getenv(const char *name, size_t name_len)
SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg)
SAPI_API void sapi_activate(void)
SAPI_API void sapi_deactivate_destroy(void)
sapi_globals_struct sapi_globals
SAPI_API void sapi_deactivate(void)
SAPI_API void sapi_deactivate_module(void)
#define SAPI_OPTION_NO_CHDIR
#define SAPI_DEFAULT_MIMETYPE
#define sapi_add_header(a, b, c)
struct _sapi_globals_struct sapi_globals_struct
struct _sapi_module_struct sapi_module_struct
#define SAPI_PHP_VERSION_HEADER
PHPAPI void php_call_shutdown_functions(void)
PHPAPI void php_free_shutdown_functions(void)
ignore_user_abort(?bool $enable=null)
fprintf($stream, string $format, mixed ... $values)
getenv(?string $name=null, bool $local_only=false)
http_response_code(int $response_code=0)
file(string $filename, int $flags=0, $context=null)
set_time_limit(int $seconds)
strrchr(string $haystack, string $needle, bool $before_needle=false)
syslog(int $priority, string $message)
fwrite($stream, string $data, ?int $length=null)
error_log(string $message, int $message_type=0, ?string $destination=null, ?string $additional_headers=null)
strpbrk(string $string, string $characters)
count(Countable|array $value, int $mode=COUNT_NORMAL)
strchr(string $haystack, string $needle, bool $before_needle=false)
headers_sent(&$filename=null, &$line=null)
PW32CP BOOL php_win32_cp_use_unicode(void)
PW32CP const struct php_win32_cp * php_win32_cp_do_update(const char *enc)
ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_random_bytes_ex(void *bytes, size_t size, char *errstr, size_t errstr_size)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
PHPAPI int php_flock(int fd, int operation)
PHPAPI zend_string * php_resolve_path(const char *filename, size_t filename_length, const char *path)
PHPAPI char * php_strip_url_passwd(char *url)
PHPAPI int php_check_open_basedir(const char *path)
PHPAPI char * expand_filepath(const char *filepath, char *real_path)
void php_win32_core_globals_ctor(void *vg)
void php_win32_core_globals_dtor(void *vg)
#define pass(a, b, c, mul)
PHPAPI zend_string * php_escape_html_entities_ex(const unsigned char *old, size_t oldlen, int all, int flags, const char *hint_charset, bool double_encode, bool quiet)
PHPAPI void(* php_internal_encoding_changed)(void)
PHPAPI const char * php_get_output_encoding(void)
PHPAPI ZEND_COLD void php_error_docref2(const char *docref, const char *param1, const char *param2, int type, const char *format,...)
PHPAPI zend_result php_lint_script(zend_file_handle *file)
PHPAPI zend_result php_stream_open_for_zend_ex(zend_file_handle *handle, int mode)
#define php_error_docref_impl(docref, type, format)
PHPAPI size_t php_printf(const char *format,...)
PHPAPI const char * php_get_input_encoding(void)
PHPAPI unsigned int php_version_id(void)
void php_request_shutdown(void *dummy)
PHPAPI bool php_get_module_initialized(void)
PHPAPI bool php_execute_script_ex(zend_file_handle *primary_file, zval *retval)
PHPAPI bool php_during_module_startup(void)
PHPAPI bool php_during_module_shutdown(void)
zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module)
PHPAPI char * php_get_version(sapi_module_struct *sapi_module)
PHPAPI void php_handle_aborted_connection(void)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
PHPAPI const char * php_get_internal_encoding(void)
php_core_globals core_globals
PHPAPI bool php_execute_script(zend_file_handle *primary_file)
PHPAPI ZEND_COLD void php_log_err_with_severity(const char *log_message, int syslog_type_int)
PHPAPI size_t php_printf_unchecked(const char *format,...)
PHPAPI char * php_get_current_user(void)
PHPAPI ZEND_COLD void php_error_docref1(const char *docref, const char *param1, int type, const char *format,...)
void php_on_timeout(int seconds)
void php_module_shutdown(void)
PHPAPI void php_html_puts(const char *str, size_t size)
PHPAPI ZEND_COLD void php_error_docref_unchecked(const char *docref, int type, const char *format,...)
PHPAPI void php_print_version(sapi_module_struct *sapi_module)
#define DEFAULT_SENDMAIL_PATH
PHPAPI int(* php_register_internal_extensions_func)(void)
zend_result php_request_startup(void)
PHPAPI void php_com_initialize(void)
PHPAPI size_t php_write(void *buf, size_t size)
zend_result php_register_extensions(zend_module_entry *const *ptr, int count)
PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int type, const char *format, va_list args)
PHPAPI const char * php_version(void)
PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret)
PHPAPI int php_handle_auth_data(const char *auth)
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
const mbfl_encoding * internal_encoding
PHPAPI void php_output_end_all(void)
PHPAPI int php_output_activate(void)
PHPAPI void php_output_set_status(int status)
PHPAPI zend_result php_output_start_user(zval *output_handler, size_t chunk_size, int flags)
PHPAPI void php_output_discard_all(void)
PHPAPI void php_output_shutdown(void)
PHPAPI size_t php_output_write(const char *str, size_t len)
PHPAPI void php_output_set_implicit_flush(int flush)
PHPAPI void php_output_startup(void)
PHPAPI void php_output_deactivate(void)
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_DEFAULT_CHARSET
PHPAPI int php_register_internal_extensions(void)
#define PHP_CONNECTION_TIMEOUT
#define PHP_CONNECTION_ABORTED
#define PHP_CONNECTION_NORMAL
#define PHP_MINFO_FUNCTION
#define php_ignore_value(x)
int php_startup_sapi_content_types(void)
PHPAPI zend_string * php_format_date(const char *format, size_t format_len, time_t ts, bool localtime)
unsigned const char * end
#define PHP_DISPLAY_ERRORS_STDOUT
struct _php_core_globals php_core_globals
#define PHP_DISPLAY_ERRORS_STDERR
int php_shutdown_config(void)
PHPAPI zval * cfg_get_entry_ex(zend_string *name)
int php_init_config(void)
PHPAPI int cfg_get_long(const char *varname, zend_long *result)
void php_ini_register_extensions(void)
#define STD_PHP_INI_ENTRY_EX
#define PHP_INI_STAGE_RUNTIME
#define PHP_INI_STAGE_DEACTIVATE
#define STD_PHP_INI_ENTRY
#define STD_PHP_INI_BOOLEAN
#define php_ini_color_displayer_cb
#define PHP_INI_STAGE_HTACCESS
#define PHP_INI_STAGE_STARTUP
PHP_JSON_API size_t int options
#define PHPWRITE(str, str_len)
#define PHP_OUTPUT_DISABLED
#define PHP_OUTPUT_HANDLER_STDFLAGS
ZEND_ATTRIBUTE_NONNULL PHPAPI void php_random_bytes_insecure_for_zend(zend_random_bytes_insecure_state *state, void *bytes, size_t size)
PHPAPI struct tm * php_localtime_r(const time_t *const timep, struct tm *p_tm)
PHPAPI char * php_strtok_r(char *s, const char *delim, char **last)
PHPAPI char * php_asctime_r(const struct tm *tm, char *buf)
unsigned char key[REFLECTION_KEY_LEN]
void UpdateIniFromRegistry(char *path)
#define php_stream_open_wrapper_as_file(path, mode, options, opened_path)
struct _php_stream php_stream
#define php_stream_auto_cleanup(stream)
#define STREAM_OPEN_FOR_ZEND_STREAM
#define STREAM_OPEN_FOR_INCLUDE
#define PHP_STREAM_BUFFER_NONE
#define php_stream_close(stream)
PHPAPI ssize_t _php_stream_read(php_stream *stream, char *buf, size_t count)
void php_shutdown_stream_hashes(void)
#define PHP_STREAM_OPTION_READ_BUFFER
int php_init_stream_wrappers(int module_number)
#define php_stream_open_wrapper(path, mode, options, opened)
#define php_stream_stat(stream, ssb)
void php_shutdown_stream_wrappers(int module_number)
#define php_stream_set_option(stream, option, value, ptrvalue)
struct _php_stream_statbuf php_stream_statbuf
PHPAPI void php_syslog(int priority, const char *format,...)
#define PHP_SYSLOG_FILTER_ALL
#define PHP_SYSLOG_FILTER_RAW
#define PHP_SYSLOG_FILTER_NO_CTRL
#define PHP_SYSLOG_FILTER_ASCII
void php_deactivate_ticks(void)
void php_shutdown_ticks(php_core_globals *core_globals)
void php_run_ticks(int count)
int php_startup_ticks(void)
PHPAPI int php_hash_environment(void)
void php_startup_auto_globals(void)
struct _php_win32_core_globals php_win32_core_globals
PHP_WINUTIL_API void php_win32_signal_ctrl_handler_init(void)
PHP_WINUTIL_API void php_win32_signal_ctrl_handler_shutdown(void)
PHPAPI void php_printf_to_smart_str(smart_str *buf, const char *format, va_list ap)
PHPAPI void php_printf_to_smart_string(smart_string *buf, const char *format, va_list ap)
#define ENT_HTML_SUBSTITUTE_ERRORS
php_stream_filter_chain readfilters
zend_string * opened_path
const char * orig_filename
void(* random_bytes_insecure_function)(zend_random_bytes_insecure_state *state, void *bytes, size_t size)
char *(* getenv_function)(const char *name, size_t name_len)
void(* printf_to_smart_str_function)(smart_str *buf, const char *format, va_list ap)
size_t(* printf_function)(const char *format,...) ZEND_ATTRIBUTE_PTR_FORMAT(printf
size_t size_t(* write_function)(const char *str, size_t str_length)
zend_string *(* resolve_path_function)(zend_string *filename)
void(* printf_to_smart_string_function)(smart_string *buf, const char *format, va_list ap)
void(* message_handler)(zend_long message, const void *data)
void(* on_timeout)(int seconds)
zval *(* get_configuration_directive)(zend_string *name)
zend_result(* stream_open_function)(zend_file_handle *handle)
FILE *(* fopen_function)(zend_string *filename, zend_string **opened_path)
void(* ticks_function)(int ticks)
void(* error_function)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message)
zend_result(* random_bytes_function)(void *bytes, size_t size, char *errstr, size_t errstr_size)
PHP_WINUTIL_API char * php_win32_error_to_msg(HRESULT error)
PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err)
PHP_WINUTIL_API char * php_win32_get_username(void)
PHP_WINUTIL_API void php_win32_error_msg_free(char *msg)
ZEND_API zend_result zend_execute_script(int type, zval *retval, zend_file_handle *file_handle)
ZEND_API zend_result zend_execute_scripts(int type, zval *retval, int file_count,...)
ZEND_API ZEND_COLD void zend_error_zstr(int type, zend_string *message)
zend_result zend_post_startup(void)
ZEND_API zend_string * zend_strpprintf_unchecked(size_t max_len, const char *format,...)
void zend_register_standard_ini_entries(void)
ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format,...)
void zend_set_utility_values(zend_utility_values *utility_values)
ZEND_API const char * get_zend_version(void)
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API void zend_activate(void)
ZEND_API void(* zend_post_shutdown_cb)(void)
void zend_call_destructors(void)
ZEND_API void zend_deactivate(void)
ZEND_API ZEND_COLD void zend_error(int type, const char *format,...)
ZEND_API size_t zend_spprintf(char **message, size_t max_len, const char *format,...)
void zend_startup(zend_utility_functions *utility_functions)
#define ZMSG_FAILED_REQUIRE_FOPEN
#define ZMSG_FAILED_HIGHLIGHT_FOPEN
ZEND_API void zend_activate_modules(void)
#define ZMSG_MEMORY_LEAK_DETECTED
struct _zend_utility_functions zend_utility_functions
ZEND_API void zend_deactivate_modules(void)
#define ZMSG_FAILED_INCLUDE_FOPEN
#define ZMSG_MEMORY_LEAK_REPEATED
struct _zend_utility_values zend_utility_values
#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL
#define ZMSG_LOG_SCRIPT_NAME
ZEND_API void zend_post_deactivate_modules(void)
ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type)
ZEND_API zend_module_entry * zend_register_internal_module(zend_module_entry *module)
ZEND_API HashTable module_registry
ZEND_API void zend_collect_module_handlers(void)
ZEND_API zend_result zend_disable_class(const char *class_name, size_t class_name_length)
ZEND_API void zend_startup_modules(void)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API void zend_disable_functions(const char *function_list)
#define ZVAL_STRING(z, s)
ZEND_API size_t zend_memory_usage(bool real_usage)
ZEND_API bool zend_alloc_in_memory_limit_error_reporting(void)
ZEND_API zend_result zend_set_memory_limit(size_t memory_limit)
ZEND_API void shutdown_memory_manager(bool silent, bool full_shutdown)
#define estrndup(s, length)
#define pefree(ptr, persistent)
#define pemalloc(size, persistent)
struct _zend_leak_info zend_leak_info
#define erealloc(ptr, size)
error_reporting(?int $error_level=null)
strncmp(string $string1, string $string2, int $length)
exit(string|int $status=0)
strcmp(string $string1, string $string2)
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 zend_op_array *(* zend_compile_file)(zend_file_handle *file_handle, int type)
void zend_init_compiler_data_structures(void)
void shutdown_compiler(void)
#define ZEND_USER_CODE(type)
ZEND_API void destroy_op_array(zend_op_array *op_array)
struct _zend_op_array zend_op_array
#define ZEND_INCLUDE_ONCE
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
#define ZEND_REQUIRE_ONCE
#define E_USER_DEPRECATED
#define E_RECOVERABLE_ERROR
#define E_COMPILE_WARNING
ZEND_API ZEND_COLD zend_object * zend_throw_error_exception(zend_class_entry *exception_ce, zend_string *message, zend_long code, int severity)
ZEND_API ZEND_COLD zend_result zend_exception_error(zend_object *ex, int severity)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
ZEND_API const char * get_active_function_name(void)
ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals)
ZEND_API const char * get_active_class_name(const char **space)
ZEND_API void zend_unset_timeout(void)
void zend_startup_extensions(void)
ZEND_API void zend_init_internal_run_time_cache(void)
void gc_globals_dtor(void)
void gc_globals_ctor(void)
#define EG_FLAGS_IN_SHUTDOWN
struct _zend_ini_scanner_globals zend_ini_scanner_globals
struct _zend_executor_globals zend_executor_globals
struct _zend_compiler_globals zend_compiler_globals
struct _zend_php_scanner_globals zend_php_scanner_globals
ZEND_API zval *ZEND_FASTCALL zend_hash_add_empty_element(HashTable *ht, zend_string *key)
ZEND_API void zend_html_puts(const char *s, size_t len)
ZEND_API zend_ulong zend_ini_parse_uquantity_warn(zend_string *value, zend_string *setting)
ZEND_API void zend_unregister_ini_entries_ex(int module_number, int module_type)
ZEND_API zend_result zend_register_ini_entries_ex(const zend_ini_entry_def *ini_entry, int module_number, int module_type)
ZEND_API void zend_ini_shutdown(void)
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)
ZEND_API void zend_ini_global_shutdown(void)
#define DISPLAY_INI_ENTRIES()
#define ZEND_INI_DISPLAY_ORIG
#define ZEND_INI_STAGE_DEACTIVATE
struct _zend_file_handle zend_file_handle
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, const char *type_name, int module_number)
ZEND_API int le_index_ptr
struct _zend_string zend_string
struct _zend_module_entry zend_module_entry
#define MODULE_PERSISTENT
ZEND_API void ZEND_FASTCALL zend_objects_store_mark_destructed(zend_objects_store *objects)
ZEND_API void zend_observer_fcall_end_all(void)
ZEND_API void zend_observer_shutdown(void)
ZEND_API void zend_observer_post_startup(void)
ZEND_API void zend_observer_startup(void)
ZEND_API void zend_observer_error_register(zend_observer_error_cb cb)
#define ZEND_OBSERVER_ENABLED
ZEND_API void zend_reset_lc_ctype_locale(void)
ZEND_API void zend_update_current_locale(void)
ZEND_API void ZEND_FASTCALL zend_str_tolower(char *str, size_t length)
ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length)
#define ALLOCA_FLAG(name)
#define do_alloca(p, use_heap)
#define free_alloca(p, use_heap)
#define UNEXPECTED(condition)
#define zend_signal_activate()
#define zend_signal_deactivate()
void zend_stream_shutdown(void)
ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *filename)
void zend_stream_init(void)
ssize_t(* zend_stream_reader_t)(void *handle, char *buf, size_t len)
ZEND_API void zend_interned_strings_deactivate(void)
ZEND_API void zend_interned_strings_dtor(void)
ZEND_API void zend_interned_strings_activate(void)
ZEND_API void zend_interned_strings_switch_storage(bool request)
ZEND_API zend_string * zend_empty_string
#define ZSTR_INIT_LITERAL(s, persistent)
#define zend_string_equals_literal(str, literal)
#define zend_string_equals_literal_ci(str, c)
void zend_startup_system_id(void)
void zend_finalize_system_id(void)
ZEND_RESULT_CODE zend_result
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
CWD_API void virtual_cwd_activate(void)
void virtual_cwd_main_cwd_init(uint8_t reinit)
virtual_cwd_globals cwd_globals
CWD_API void virtual_cwd_deactivate(void)
#define VCWD_CHDIR_FILE(path)
#define VCWD_OPEN_MODE(path, flags, mode)
#define VCWD_GETCWD(buff, size)
struct _virtual_cwd_globals virtual_cwd_globals
#define VCWD_ACCESS(pathname, mode)
#define VCWD_STAT(path, buff)
#define VCWD_REALPATH(path, real_path)
function(EX_VAR(opline->result.var))
#define ZEND_INCLUDE_OR_EVAL