17#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
39#define HttpPost curl_httppost
43#if defined(ZTS) && defined(HAVE_CURL_OLD_OPENSSL)
44# if defined(HAVE_OPENSSL_CRYPTO_H)
45# define PHP_CURL_NEED_OPENSSL_TSL
46# include <openssl/crypto.h>
49 "libcurl was compiled with OpenSSL support, but configure could not find " \
50 "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
51 "cause random crashes on SSL requests"
65# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
70#ifdef PHP_CURL_NEED_OPENSSL_TSL
71static MUTEX_T *php_curl_openssl_tsl =
NULL;
77 if (
mode & CRYPTO_LOCK) {
78 tsrm_mutex_lock(php_curl_openssl_tsl[
n]);
80 tsrm_mutex_unlock(php_curl_openssl_tsl[
n]);
86 return (
unsigned long) tsrm_thread_id();
91#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s) - 1, (zend_long) v);
92#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s) - 1, (double) v);
93#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s) - 1, (char *) (v ? v : ""));
94#define CAASTR(s, v) add_assoc_str_ex(return_value, s, sizeof(s) - 1, \
95 v ? zend_string_copy(v) : ZSTR_EMPTY_ALLOC());
96#define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s) -1 , (zval *) v);
98#if defined(PHP_WIN32) || defined(__GNUC__)
99# define php_curl_ret(__ret) RETVAL_FALSE; return __ret;
101# define php_curl_ret(__ret) RETVAL_FALSE; return;
106 if (zend_char_has_nul_byte(str,
len)) {
111 CURLcode
error = curl_easy_setopt(
ch->cp, option, str);
120 if (
PG(open_basedir) && *
PG(open_basedir)) {
127 &&
'/' !=
ZSTR_VAL(url)[
sizeof(
"file://") - 1]
132 memmove(_tmp,
"file:///",
sizeof(
"file:///") - 1);
133 memmove(_tmp +
sizeof(
"file:///") - 1,
ZSTR_VAL(url) +
sizeof(
"file://") - 1,
ZSTR_LEN(url) -
sizeof(
"file://") + 1);
151 if (stream ==
NULL) {
161 if (
ch->handlers.read && !
Z_ISUNDEF(
ch->handlers.read->stream)) {
163 if (stream ==
NULL) {
169 ch->handlers.read->res =
NULL;
170 ch->handlers.read->fp = 0;
175 if (
ch->handlers.write_header && !
Z_ISUNDEF(
ch->handlers.write_header->stream)) {
177 if (stream ==
NULL) {
183 ch->handlers.write_header->fp = 0;
189 if (
ch->handlers.write && !
Z_ISUNDEF(
ch->handlers.write->stream)) {
191 if (stream ==
NULL) {
197 ch->handlers.write->fp = 0;
222#ifdef COMPILE_DL_CURL
249 curl_version_info_data *d;
258 snprintf(str,
sizeof(str),
"%d", d->age);
271 static const struct feat feats[] = {
295#if LIBCURL_VERSION_NUM >= 0x074001
298#if LIBCURL_VERSION_NUM >= 0x074200
301#if LIBCURL_VERSION_NUM >= 0x074800
305#if LIBCURL_VERSION_NUM >= 0x074a00
308#if LIBCURL_VERSION_NUM >= 0x074c00
315 for(i=0; i<
sizeof(feats)/
sizeof(feats[0]); i++) {
323 p = (
char **) d->protocols;
325 n +=
snprintf(str +
n,
sizeof(str) -
n,
"%s%s", *
p, *(
p + 1) !=
NULL ?
", " :
"");
332 if (d->ssl_version) {
336 if (d->libz_version) {
340#if defined(CURLVERSION_SECOND) && CURLVERSION_NOW >= CURLVERSION_SECOND
346#if defined(CURLVERSION_THIRD) && CURLVERSION_NOW >= CURLVERSION_THIRD
352 if (d->iconv_ver_num) {
356 if (d->libssh_version) {
371 register_curl_symbols(module_number);
373#ifdef PHP_CURL_NEED_OPENSSL_TSL
374 if (!CRYPTO_get_id_callback()) {
375 int i, c = CRYPTO_num_locks();
377 php_curl_openssl_tsl = malloc(c *
sizeof(MUTEX_T));
378 if (!php_curl_openssl_tsl) {
382 for (i = 0; i < c; ++i) {
383 php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
386 CRYPTO_set_id_callback(php_curl_ssl_id);
387 CRYPTO_set_locking_callback(php_curl_ssl_lock);
391 if (curl_global_init(CURL_GLOBAL_DEFAULT) !=
CURLE_OK) {
395 curl_ce = register_class_CurlHandle();
396 curl_ce->create_object = curl_create_object;
397 curl_ce->default_object_handlers = &curl_object_handlers;
401 curl_object_handlers.free_obj = curl_free_obj;
402 curl_object_handlers.get_gc = curl_get_gc;
403 curl_object_handlers.get_constructor = curl_get_constructor;
404 curl_object_handlers.clone_obj = curl_clone_obj;
442 clone_object = curl_create_object(
curl_ce);
443 clone_ch = curl_from_obj(clone_object);
446 ch = curl_from_obj(
object);
447 cp = curl_easy_duphandle(
ch->cp);
450 return &clone_ch->
std;
458 if (build_mime_structure_from_hash(clone_ch, postfields) ==
FAILURE) {
460 return &clone_ch->
std;
464 return &clone_ch->
std;
469 php_curl *curl = curl_from_obj(
object);
473 zend_get_gc_buffer_add_zval(gc_buffer, &curl->
postfields);
508 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->
handlers.
debug);
511#if LIBCURL_VERSION_NUM >= 0x075000
513 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->
handlers.prereq);
516#if LIBCURL_VERSION_NUM >= 0x075400
518 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->
handlers.sshhostkey);
523 zend_get_gc_buffer_add_zval(gc_buffer, &curl->
private_data);
525 zend_get_gc_buffer_use(gc_buffer, table,
n);
545 curl_global_cleanup();
546#ifdef PHP_CURL_NEED_OPENSSL_TSL
547 if (php_curl_openssl_tsl) {
548 int i, c = CRYPTO_num_locks();
550 CRYPTO_set_id_callback(
NULL);
551 CRYPTO_set_locking_callback(
NULL);
553 for (i = 0; i < c; ++i) {
554 tsrm_mutex_free(php_curl_openssl_tsl[i]);
557 free(php_curl_openssl_tsl);
558 php_curl_openssl_tsl =
NULL;
567static size_t curl_write(
char *
data,
size_t size,
size_t nmemb,
void *ctx)
571 size_t length =
size * nmemb;
574 fprintf(stderr,
"curl_write() called\n");
575 fprintf(stderr,
"data = %s, size = %d, nmemb = %d, ctx = %x\n",
data,
size, nmemb, ctx);
578 switch (write_handler->
method) {
586 smart_str_appendl(&write_handler->
buf,
data, (
int) length);
597 ch->in_callback =
true;
598 zend_call_known_fcc(&write_handler->
fcc, &
retval, 2, argv,
NULL);
599 ch->in_callback =
false;
603 length = zval_get_long(&
retval);
617static int curl_fnmatch(
void *ctx,
const char *pattern,
const char *
string)
629 ch->in_callback =
true;
630 zend_call_known_fcc(&
ch->handlers.fnmatch, &
retval, 3, argv,
NULL);
631 ch->in_callback =
false;
636 rval = zval_get_long(&
retval);
646static size_t curl_progress(
void *clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow)
652 fprintf(stderr,
"curl_progress() called\n");
653 fprintf(stderr,
"clientp = %x, dltotal = %f, dlnow = %f, ultotal = %f, ulnow = %f\n", clientp, dltotal, dlnow, ultotal, ulnow);
666 ch->in_callback =
true;
668 ch->in_callback =
false;
673 if (0 != zval_get_long(&
retval)) {
684static size_t curl_xferinfo(
void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
690 fprintf(stderr,
"curl_xferinfo() called\n");
691 fprintf(stderr,
"clientp = %x, dltotal = %ld, dlnow = %ld, ultotal = %ld, ulnow = %ld\n", clientp, dltotal, dlnow, ultotal, ulnow);
704 ch->in_callback =
true;
705 zend_call_known_fcc(&
ch->handlers.xferinfo, &
retval, 5, argv,
NULL);
706 ch->in_callback =
false;
711 if (0 != zval_get_long(&
retval)) {
721#if LIBCURL_VERSION_NUM >= 0x075000
722static int curl_prereqfunction(
void *clientp,
char *conn_primary_ip,
char *conn_local_ip,
int conn_primary_port,
int conn_local_port)
735 fprintf(stderr,
"curl_prereqfunction() called\n");
736 fprintf(stderr,
"conn_primary_ip = %s, conn_local_ip = %s, conn_primary_port = %d, conn_local_port = %d\n", conn_primary_ip, conn_local_ip, conn_primary_port, conn_local_port);
749 ch->in_callback =
true;
751 ch->in_callback =
false;
760 zend_value_error(
"The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT");
763 zend_type_error(
"The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT");
775#if LIBCURL_VERSION_NUM >= 0x075400
776static int curl_ssh_hostkeyfunction(
void *clientp,
int keytype,
const char *
key,
size_t keylen)
782 fprintf(stderr,
"curl_ssh_hostkeyfunction() called\n");
783 fprintf(stderr,
"clientp = %x, keytype = %d, key = %s, keylen = %zu\n", clientp, keytype,
key, keylen);
795 ch->in_callback =
true;
797 ch->in_callback =
false;
806 zend_throw_error(
NULL,
"The CURLOPT_SSH_HOSTKEYFUNCTION callback must return either CURLKHMATCH_OK or CURLKHMATCH_MISMATCH");
809 zend_throw_error(
NULL,
"The CURLOPT_SSH_HOSTKEYFUNCTION callback must return either CURLKHMATCH_OK or CURLKHMATCH_MISMATCH");
820static size_t curl_read(
char *
data,
size_t size,
size_t nmemb,
void *ctx)
826 switch (read_handler->
method) {
828 if (read_handler->
fp) {
838 if (read_handler->
res) {
846 ch->in_callback =
true;
847 zend_call_known_fcc(&read_handler->
fcc, &
retval, 3, argv,
NULL);
848 ch->in_callback =
false;
872static size_t curl_write_header(
char *
data,
size_t size,
size_t nmemb,
void *ctx)
876 size_t length =
size * nmemb;
878 switch (write_handler->
method) {
883 smart_str_appendl(&
ch->handlers.write->buf,
data, (
int) length);
898 ch->in_callback =
true;
899 zend_call_known_fcc(&write_handler->
fcc, &
retval, 2, argv,
NULL);
900 ch->in_callback =
false;
904 length = zval_get_long(&
retval);
922static int curl_debug(CURL *
handle, curl_infotype
type,
char *
data,
size_t size,
void *clientp)
927 fprintf(stderr,
"curl_debug() called\n");
937 if (
ch->header.str) {
940 ch->header.str = zend_string_init(
data,
size, 0);
954 ch->in_callback =
true;
956 ch->in_callback =
false;
966static void curl_free_post(
void **post)
968 curl_mime_free((curl_mime *)*post);
978static void curl_free_cb_arg(
void **cb_arg_p)
983 zend_string_release(cb_arg->
filename);
989static void curl_free_slist(
zval *el)
991 curl_slist_free_all(((
struct curl_slist *)
Z_PTR_P(el)));
998 curl_version_info_data *d;
1009 CAAL(
"version_number", d->version_num);
1010 CAAL(
"age", d->age);
1011 CAAL(
"features", d->features);
1024 static const struct feat feats[] = {
1048#if LIBCURL_VERSION_NUM >= 0x074001
1051#if LIBCURL_VERSION_NUM >= 0x074200
1054#if LIBCURL_VERSION_NUM >= 0x074800
1058#if LIBCURL_VERSION_NUM >= 0x074a00
1061#if LIBCURL_VERSION_NUM >= 0x074c00
1066 for(i = 0; i <
sizeof(feats) /
sizeof(feats[0]); i++) {
1067 if (feats[i].
name) {
1068 add_assoc_bool(&feature_list, feats[i].
name, d->features & feats[i].bitmask ?
true :
false);
1072 CAAZ(
"feature_list", &feature_list);
1074 CAAL(
"ssl_version_number", d->ssl_version_num);
1075 CAAS(
"version", d->version);
1076 CAAS(
"host", d->host);
1077 CAAS(
"ssl_version", d->ssl_version);
1078 CAAS(
"libz_version", d->libz_version);
1081 char **
p = (
char **) d->protocols;
1086 while (*
p !=
NULL) {
1090 CAAZ(
"protocols", &protocol_list);
1093 CAAS(
"ares", d->ares);
1094 CAAL(
"ares_num", d->ares_num);
1097 CAAS(
"libidn", d->libidn);
1100 CAAL(
"iconv_ver_num", d->iconv_ver_num);
1101 CAAS(
"libssh_version", d->libssh_version);
1104 CAAL(
"brotli_ver_num", d->brotli_ver_num);
1105 CAAS(
"brotli_version", d->brotli_version);
1132#if LIBCURL_VERSION_NUM >= 0x075000
1135#if LIBCURL_VERSION_NUM >= 0x075400
1154static void create_certinfo(
struct curl_certinfo *ci,
zval *listcode)
1161 for (i=0; i<ci->num_of_certs; i++) {
1162 struct curl_slist *slist;
1165 for (slist = ci->certinfo[i]; slist; slist = slist->next) {
1169 strncpy(
s, slist->data,
sizeof(
s));
1170 s[
sizeof(
s)-1] =
'\0';
1171 tmp = memchr(
s,
':',
sizeof(
s));
1175 add_assoc_string(&certhash,
s, &slist->data[
len+1]);
1180 add_next_index_zval(listcode, &certhash);
1188static void _php_curl_set_default_options(
php_curl *
ch)
1194 curl_easy_setopt(
ch->cp, CURLOPT_ERRORBUFFER,
ch->err.str);
1204 cainfo =
INI_STR(
"openssl.cafile");
1205 if (!(cainfo && cainfo[0] !=
'\0')) {
1206 cainfo =
INI_STR(
"curl.cainfo");
1208 if (cainfo && cainfo[0] !=
'\0') {
1230 cp = curl_easy_init();
1244 _php_curl_set_default_options(
ch);
1247 if (php_curl_option_url(
ch, url) ==
FAILURE) {
1258 zend_fcc_dup(target_fcc, source_fcc);
1259 curl_easy_setopt(
ch->cp, option, (
void *)
ch);
1296 curl_easy_setopt(
ch->cp, CURLOPT_ERRORBUFFER,
ch->err.str);
1300 curl_easy_setopt(
ch->cp, CURLOPT_DEBUGDATA, (
void *)
ch);
1302 php_curl_copy_fcc_with_option(
ch, CURLOPT_PROGRESSDATA, &
ch->handlers.progress, &source->
handlers.
progress);
1303 php_curl_copy_fcc_with_option(
ch, CURLOPT_XFERINFODATA, &
ch->handlers.xferinfo, &source->
handlers.
xferinfo);
1304 php_curl_copy_fcc_with_option(
ch, CURLOPT_FNMATCH_DATA, &
ch->handlers.fnmatch, &source->
handlers.
fnmatch);
1305 php_curl_copy_fcc_with_option(
ch, CURLOPT_DEBUGDATA, &
ch->handlers.debug, &source->
handlers.
debug);
1306#if LIBCURL_VERSION_NUM >= 0x075000
1307 php_curl_copy_fcc_with_option(
ch, CURLOPT_PREREQDATA, &
ch->handlers.prereq, &source->
handlers.prereq);
1309#if LIBCURL_VERSION_NUM >= 0x075400
1310 php_curl_copy_fcc_with_option(
ch, CURLOPT_SSH_HOSTKEYDATA, &
ch->handlers.sshhostkey, &source->
handlers.sshhostkey);
1325static size_t read_cb(
char *
buffer,
size_t size,
size_t nitems,
void *
arg)
1332 return CURL_READFUNC_ABORT;
1339 return CURL_READFUNC_ABORT;
1345static int seek_cb(
void *
arg, curl_off_t
offset,
int origin)
1351 return CURL_SEEKFUNC_CANTSEEK;
1354 return res ==
SUCCESS ? CURL_SEEKFUNC_OK : CURL_SEEKFUNC_CANTSEEK;
1358static void free_cb(
void *
arg)
1372 curl_mimepart *part;
1373 CURLcode form_error;
1376 postval = zval_get_tmp_string(
current, &tmp_postval);
1378 part = curl_mime_addpart(mime);
1380 zend_tmp_string_release(tmp_postval);
1389 zend_tmp_string_release(tmp_postval);
1401 curl_mime *mime =
NULL;
1402 curl_mimepart *part;
1403 CURLcode form_error;
1405 if (zend_hash_num_elements(postfields) > 0) {
1406 mime = curl_mime_init(
ch->cp);
1418 zend_string_addref(string_key);
1431 curl_seek_callback seekfunc = seek_cb;
1466 part = curl_mime_addpart(mime);
1474 cb_arg =
emalloc(
sizeof *cb_arg);
1475 cb_arg->
filename = zend_string_copy(postval);
1479 || (form_error = curl_mime_data_cb(part,
filesize, read_cb, seekfunc, free_cb, cb_arg)) !=
CURLE_OK
1481 || (form_error = curl_mime_type(part,
type ?
type :
"application/octet-stream")) !=
CURLE_OK) {
1526 part = curl_mime_addpart(mime);
1533 || (form_error = curl_mime_type(part,
type)) !=
CURLE_OK) {
1542 zval *current_element;
1545 add_simple_field(mime, string_key, current_element);
1552 add_simple_field(mime, string_key,
current);
1562 if ((*
ch->clone) == 1) {
1566 error = curl_easy_setopt(
ch->cp, CURLOPT_MIMEPOST, mime);
1574 curl_mime_free(mime);
1594 cp = curl_easy_duphandle(
ch->cp);
1605 postfields = &
ch->postfields;
1607 if (build_mime_structure_from_hash(dupch, postfields) ==
FAILURE) {
1616static bool php_curl_set_callable_handler(
zend_fcall_info_cache *
const handler_fcc,
zval *callable,
bool is_array_config,
const char *option_name)
1619 zend_fcc_dtor(handler_fcc);
1634 zend_fcc_addref(handler_fcc);
1639#define HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(curl_ptr, constant_no_function, handler_type, default_method) \
1640 case constant_no_function##FUNCTION: { \
1641 bool result = php_curl_set_callable_handler(&curl_ptr->handlers.handler_type->fcc, zvalue, is_array_config, #constant_no_function "FUNCTION"); \
1643 curl_ptr->handlers.handler_type->method = default_method; \
1646 if (!ZEND_FCC_INITIALIZED(curl_ptr->handlers.handler_type->fcc)) { \
1647 curl_ptr->handlers.handler_type->method = default_method; \
1650 curl_ptr->handlers.handler_type->method = PHP_CURL_USER; \
1654#define HANDLE_CURL_OPTION_CALLABLE(curl_ptr, constant_no_function, handler_fcc, c_callback) \
1655 case constant_no_function##FUNCTION: { \
1656 bool result = php_curl_set_callable_handler(&curl_ptr->handler_fcc, zvalue, is_array_config, #constant_no_function "FUNCTION"); \
1660 curl_easy_setopt(curl_ptr->cp, constant_no_function##FUNCTION, (c_callback)); \
1661 curl_easy_setopt(curl_ptr->cp, constant_no_function##DATA, curl_ptr); \
1681#if LIBCURL_VERSION_NUM >= 0x075000
1684#if LIBCURL_VERSION_NUM >= 0x075400
1690 lval = zval_get_long(zvalue);
1693 error = curl_easy_setopt(
ch->cp, option, 2);
1805#if LIBCURL_VERSION_NUM >= 0x073E00
1809#if LIBCURL_VERSION_NUM >= 0x074000
1812#if LIBCURL_VERSION_NUM >= 0x074001
1815#if LIBCURL_VERSION_NUM >= 0x074100
1818#if LIBCURL_VERSION_NUM >= 0x074500
1821#if LIBCURL_VERSION_NUM >= 0x074a00
1824#if LIBCURL_VERSION_NUM >= 0x074c00
1829#if LIBCURL_VERSION_NUM >= 0x075000
1832#if LIBCURL_VERSION_NUM >= 0x075100
1835#if LIBCURL_VERSION_NUM >= 0x075600
1838#if LIBCURL_VERSION_NUM >= 0x075700
1842#if LIBCURL_VERSION_NUM >= 0x080900
1845 lval = zval_get_long(zvalue);
1851 error = curl_easy_setopt(
ch->cp, option, lval);
1916#if LIBCURL_VERSION_NUM >= 0x074001
1919#if LIBCURL_VERSION_NUM >= 0x074200
1922#if LIBCURL_VERSION_NUM >= 0x074700
1925#if LIBCURL_VERSION_NUM >= 0x074900
1928#if LIBCURL_VERSION_NUM >= 0x074b00
1931#if LIBCURL_VERSION_NUM >= 0x075000
1934#if LIBCURL_VERSION_NUM >= 0x075500
1940 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
1941#if LIBCURL_VERSION_NUM >= 0x075500
1943 (
PG(open_basedir) && *
PG(open_basedir))
1946 zend_tmp_string_release(tmp_str);
1952 zend_tmp_string_release(tmp_str);
1968#if LIBCURL_VERSION_NUM >= 0x073E00
1971#if LIBCURL_VERSION_NUM >= 0x074a00
1986 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
1988 zend_tmp_string_release(tmp_str);
2006 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
2008 zend_tmp_string_release(tmp_str);
2043 ch->handlers.write->fp =
NULL;
2045 }
else if (what->
mode[0] !=
'r' || what->
mode[1] ==
'+') {
2047 ch->handlers.write->fp = fp;
2057 if (!
Z_ISUNDEF(
ch->handlers.write_header->stream)) {
2061 ch->handlers.write_header->fp =
NULL;
2063 }
else if (what->
mode[0] !=
'r' || what->
mode[1] ==
'+') {
2065 ch->handlers.write_header->fp = fp;
2067 ZVAL_COPY(&
ch->handlers.write_header->stream, zvalue);
2079 ch->handlers.read->fp =
NULL;
2080 ch->handlers.read->res =
NULL;
2083 ch->handlers.read->fp = fp;
2084 ch->handlers.read->res =
Z_RES_P(zvalue);
2094 }
else if (what->
mode[0] !=
'r' || what->
mode[1] ==
'+') {
2103 error = curl_easy_setopt(
ch->cp, option, fp);
2124 struct curl_slist *slist =
NULL;
2130 name =
"CURLOPT_HTTPHEADER";
2133 name =
"CURLOPT_QUOTE";
2136 name =
"CURLOPT_HTTP200ALIASES";
2139 name =
"CURLOPT_POSTQUOTE";
2142 name =
"CURLOPT_PREQUOTE";
2145 name =
"CURLOPT_TELNETOPTIONS";
2148 name =
"CURLOPT_MAIL_RCPT";
2151 name =
"CURLOPT_RESOLVE";
2154 name =
"CURLOPT_PROXYHEADER";
2157 name =
"CURLOPT_CONNECT_TO";
2168 val = zval_get_tmp_string(
current, &tmp_val);
2170 zend_tmp_string_release(tmp_val);
2178 if ((*
ch->clone) == 1) {
2179 zend_hash_index_update_ptr(
ch->to_free->slist, option, slist);
2181 zend_hash_next_index_insert_ptr(
ch->to_free->slist, slist);
2185 error = curl_easy_setopt(
ch->cp, option, slist);
2197 error = curl_easy_setopt(
ch->cp, option, lval);
2202 if (zend_hash_num_elements(
HASH_OF(zvalue)) == 0) {
2206 error = curl_easy_setopt(
ch->cp, CURLOPT_POSTFIELDSIZE, 0);
2208 return build_mime_structure_from_hash(
ch, zvalue);
2212 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
2214 error = curl_easy_setopt(
ch->cp, CURLOPT_POSTFIELDSIZE,
ZSTR_LEN(str));
2215 error = curl_easy_setopt(
ch->cp, CURLOPT_COPYPOSTFIELDS,
ZSTR_VAL(str));
2216 zend_tmp_string_release(tmp_str);
2233 lval = zval_get_long(zvalue);
2234 error = curl_easy_setopt(
ch->cp, option, (curl_off_t)lval);
2238 lval = zval_get_long(zvalue);
2257 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
2261 zend_tmp_string_release(tmp_str);
2266 zend_tmp_string_release(tmp_str);
2272 zend_value_error(
"CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set");
2278 curl_easy_setopt(
ch->cp, CURLOPT_DEBUGDATA, (
void *)
ch);
2282 curl_easy_setopt(
ch->cp, CURLOPT_DEBUGDATA,
NULL);
2303#if LIBCURL_VERSION_NUM >= 0x074700
2310#if LIBCURL_VERSION_NUM >= 0x074d00
2316 zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
2318 struct curl_blob stblob;
2321 stblob.flags = CURL_BLOB_COPY;
2322 error = curl_easy_setopt(
ch->cp, option, &stblob);
2324 zend_tmp_string_release(tmp_str);
2330 if (is_array_config) {
2335 error = CURLE_UNKNOWN_OPTION;
2374 zval *zid, *arr, *entry;
2406 smart_str_free(&
ch->handlers.write->buf);
2407 if (
ch->header.str) {
2412 memset(
ch->err.str, 0, CURL_ERROR_SIZE + 1);
2434 error = curl_easy_perform(
ch->cp);
2438 smart_str_free(&
ch->handlers.write->buf);
2451 smart_str_0(&
ch->handlers.write->buf);
2459 if (
ch->handlers.write_header->method ==
PHP_CURL_FILE &&
ch->handlers.write_header->fp) {
2460 fflush(
ch->handlers.write_header->fp);
2477 bool option_is_null = 1;
2487 if (option_is_null) {
2495 struct curl_certinfo *ci =
NULL;
2502 CAAS(
"url", s_code);
2505 if (s_code !=
NULL) {
2506 CAAS(
"content_type", s_code);
2510 CAAZ(
"content_type", &retnull);
2514 CAAL(
"http_code", l_code);
2517 CAAL(
"header_size", l_code);
2520 CAAL(
"request_size", l_code);
2523 CAAL(
"filetime", l_code);
2526 CAAL(
"ssl_verify_result", l_code);
2529 CAAL(
"redirect_count", l_code);
2532 CAAD(
"total_time", d_code);
2535 CAAD(
"namelookup_time", d_code);
2538 CAAD(
"connect_time", d_code);
2541 CAAD(
"pretransfer_time", d_code);
2544 CAAD(
"size_upload", d_code);
2547 CAAD(
"size_download", d_code);
2550 CAAD(
"speed_download", d_code);
2553 CAAD(
"speed_upload", d_code);
2556 CAAD(
"download_content_length", d_code);
2559 CAAD(
"upload_content_length", d_code);
2562 CAAD(
"starttransfer_time", d_code);
2565 CAAD(
"redirect_time", d_code);
2568 CAAS(
"redirect_url", s_code);
2571 CAAS(
"primary_ip", s_code);
2575 create_certinfo(ci, &listcode);
2576 CAAZ(
"certinfo", &listcode);
2579 CAAL(
"primary_port", l_code);
2582 CAAS(
"local_ip", s_code);
2585 CAAL(
"local_port", l_code);
2588 CAAL(
"http_version", l_code);
2591 CAAL(
"protocol", l_code);
2594 CAAL(
"ssl_verifyresult", l_code);
2597 CAAS(
"scheme", s_code);
2600 CAAL(
"appconnect_time_us", co);
2603 CAAL(
"connect_time_us", co);
2606 CAAL(
"namelookup_time_us", co);
2609 CAAL(
"pretransfer_time_us", co);
2612 CAAL(
"redirect_time_us", co);
2615 CAAL(
"starttransfer_time_us", co);
2617#if LIBCURL_VERSION_NUM >= 0x080a00
2619 CAAL(
"posttransfer_time_us", co);
2623 CAAL(
"total_time_us", co);
2625 if (
ch->header.str) {
2626 CAASTR(
"request_header",
ch->header.str);
2628#if LIBCURL_VERSION_NUM >= 0x074800
2630 CAAS(
"effective_method", s_code);
2633#if LIBCURL_VERSION_NUM >= 0x075400
2635 CAAS(
"capath", s_code);
2638 CAAS(
"cainfo", s_code);
2644 if (
ch->header.str) {
2650 struct curl_certinfo *ci =
NULL;
2669 int type = CURLINFO_TYPEMASK & option;
2671 case CURLINFO_STRING:
2673 char *s_code =
NULL;
2675 if (curl_easy_getinfo(
ch->cp, option, &s_code) ==
CURLE_OK && s_code) {
2686 if (curl_easy_getinfo(
ch->cp, option, &code) ==
CURLE_OK) {
2693 case CURLINFO_DOUBLE:
2697 if (curl_easy_getinfo(
ch->cp, option, &code) ==
CURLE_OK) {
2704 case CURLINFO_SLIST:
2706 struct curl_slist *slist;
2707 if (curl_easy_getinfo(
ch->cp, option, &slist) ==
CURLE_OK) {
2708 struct curl_slist *
current = slist;
2714 curl_slist_free_all(slist);
2720 case CURLINFO_OFF_T:
2723 if (curl_easy_getinfo(
ch->cp, option, &c_off) ==
CURLE_OK) {
2752 ch->err.str[CURL_ERROR_SIZE] = 0;
2792 if (
ch->in_callback) {
2804 fprintf(stderr,
"DTOR CALLED, ch = %x\n",
ch);
2815 curl_easy_cleanup(
ch->cp);
2818 if (--(*
ch->clone) == 0) {
2828 smart_str_free(&
ch->handlers.write->buf);
2830 zend_fcc_dtor(&
ch->handlers.write->fcc);
2833 zend_fcc_dtor(&
ch->handlers.write_header->fcc);
2836 zend_fcc_dtor(&
ch->handlers.read->fcc);
2839 if (
ch->header.str) {
2848 efree(
ch->handlers.write_header);
2852 zend_fcc_dtor(&
ch->handlers.progress);
2855 zend_fcc_dtor(&
ch->handlers.xferinfo);
2858 zend_fcc_dtor(&
ch->handlers.fnmatch);
2861 zend_fcc_dtor(&
ch->handlers.debug);
2863#if LIBCURL_VERSION_NUM >= 0x075000
2865 zend_fcc_dtor(&
ch->handlers.prereq);
2868#if LIBCURL_VERSION_NUM >= 0x075400
2870 zend_fcc_dtor(&
ch->handlers.sshhostkey);
2895 str = curl_easy_strerror(code);
2906static void _php_curl_reset_handlers(
php_curl *
ch)
2912 ch->handlers.write->fp =
NULL;
2915 if (!
Z_ISUNDEF(
ch->handlers.write_header->stream)) {
2919 ch->handlers.write_header->fp =
NULL;
2926 ch->handlers.read->fp =
NULL;
2927 ch->handlers.read->res =
NULL;
2936 zend_fcc_dtor(&
ch->handlers.progress);
2940 zend_fcc_dtor(&
ch->handlers.xferinfo);
2944 zend_fcc_dtor(&
ch->handlers.fnmatch);
2948 zend_fcc_dtor(&
ch->handlers.debug);
2950#if LIBCURL_VERSION_NUM >= 0x075000
2952 zend_fcc_dtor(&
ch->handlers.prereq);
2955#if LIBCURL_VERSION_NUM >= 0x075400
2957 zend_fcc_dtor(&
ch->handlers.sshhostkey);
2975 if (
ch->in_callback) {
2980 curl_easy_reset(
ch->cp);
2981 _php_curl_reset_handlers(
ch);
2982 _php_curl_set_default_options(
ch);
3061#if LIBCURL_VERSION_NUM >= 0x073E00
fprintf($stream, string $format, mixed ... $values)
file(string $filename, int $flags=0, $context=null)
fwrite($stream, string $data, ?int $length=null)
fread($stream, int $length)
filesize(string $filename)
void _php_curl_cleanup_handle(php_curl *ch)
void init_curl_handle(php_curl *ch)
#define HANDLE_CURL_OPTION_CALLABLE(curl_ptr, constant_no_function, handler_fcc, c_callback)
zend_class_entry * curl_ce
php_curl * init_curl_handle_into_zval(zval *curl)
zend_result curl_cast_object(zend_object *obj, zval *result, int type)
zend_class_entry * curl_share_ce
void _php_curl_verify_handlers(php_curl *ch, bool reporterror)
#define HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(curl_ptr, constant_no_function, handler_type, default_method)
zend_module_entry curl_module_entry
void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source)
const CURLOPT_RESUME_FROM
const CURLINFO_STARTTRANSFER_TIME_T
const CURLOPT_EXPECT_100_TIMEOUT_MS
const CURLOPT_SSL_VERIFYPEER
const CURLOPT_SSLCERTTYPE
curl_strerror(int $error_code)
const CURLOPT_REDIR_PROTOCOLS
const CURLOPT_PROXY_SERVICE_NAME
curl_setopt_array(CurlHandle $handle, array $options)
const CURLOPT_SSL_ENABLE_NPN
const CURLINFO_SSL_VERIFYRESULT
const CURLOPT_SSL_ENABLE_ALPN
const CURLOPT_ISSUERCERT_BLOB
const CURLOPT_LOW_SPEED_TIME
const CURLINFO_TOTAL_TIME
const CURLOPT_TFTP_NO_OPTIONS
const CURLOPT_DNS_INTERFACE
const CURLOPT_HTTPPROXYTUNNEL
const CURLOPT_TLSAUTH_PASSWORD
const CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
const CURLINFO_CONNECT_TIME
const CURLINFO_HEADER_OUT
const CURLOPT_PROXYUSERNAME
const CURLOPT_PROTOCOLS_STR
const CURLINFO_PROXY_SSL_VERIFYRESULT
const CURLOPT_PROXY_CAPATH
const CURLOPT_PROXY_ISSUERCERT
curl_errno(CurlHandle $handle)
const CURLOPT_DNS_LOCAL_IP6
const CURLINFO_CONTENT_LENGTH_UPLOAD
const CURLOPT_PROXY_SSLCERT
curl_upkeep(CurlHandle $handle)
const CURL_VERSION_GSSAPI
const CURLOPT_UPKEEP_INTERVAL_MS
const CURLOPT_TRANSFER_ENCODING
const CURLOPT_SSH_PUBLIC_KEYFILE
const CURLOPT_PROXY_SSLCERTTYPE
const CURLOPT_SUPPRESS_CONNECT_HEADERS
const CURLOPT_DNS_SERVERS
curl_unescape(CurlHandle $handle, string $string)
const CURLINFO_POSTTRANSFER_TIME_T
const CURLINFO_PRIMARY_PORT
const CURLOPT_PROXY_TLSAUTH_TYPE
const CURLOPT_KEEP_SENDING_ON_ERROR
const CURLOPT_MAX_RECV_SPEED_LARGE
const CURLINFO_EFFECTIVE_METHOD
const CURLOPT_PROXYUSERPWD
const CURLOPT_CONNECTTIMEOUT_MS
const CURLINFO_PRIMARY_IP
const CURL_VERSION_ALTSVC
curl_copy_handle(CurlHandle $handle)
const CURLOPT_TLSAUTH_USERNAME
const CURLOPT_DNS_USE_GLOBAL_CACHE
const CURLOPT_PROXY_SSL_CIPHER_LIST
const CURLOPT_ACCEPTTIMEOUT_MS
const CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
const CURLOPT_SOCKS5_GSSAPI_SERVICE
const CURLOPT_MAXFILESIZE
const CURLINFO_HTTP_VERSION
const CURLOPT_TELNETOPTIONS
const CURLOPT_PROXY_TRANSFER_MODE
const CURLOPT_FTP_USE_EPSV
const CURLOPT_TIMEVALUE_LARGE
curl_reset(CurlHandle $handle)
const CURLOPT_SERVER_RESPONSE_TIMEOUT
const CURL_VERSION_TLSAUTH_SRP
const CURLOPT_SSL_SESSIONID_CACHE
const CURL_VERSION_UNICODE
const CURLOPT_IGNORE_CONTENT_LENGTH
const CURLOPT_PROXY_CAINFO
const CURLOPT_DIRLISTONLY
const CURLOPT_HAPROXYPROTOCOL
const CURLINFO_SIZE_UPLOAD
const CURLOPT_LOGIN_OPTIONS
const CURLE_OUT_OF_MEMORY
const CURL_FNMATCHFUNC_FAIL
const CURLINFO_SIZE_DOWNLOAD
const CURL_VERSION_LARGEFILE
const CURLOPT_TCP_FASTOPEN
const CURLINFO_PRETRANSFER_TIME
const CURL_VERSION_BROTLI
const CURLKHMATCH_MISMATCH
const CURLINFO_STARTTRANSFER_TIME
curl_getinfo(CurlHandle $handle, ?int $option=null)
const CURL_VERSION_UNIX_SOCKETS
const CURLOPT_CUSTOMREQUEST
curl_setopt(CurlHandle $handle, int $option, mixed $value)
const CURLOPT_PROXY_TLS13_CIPHERS
const CURLOPT_READFUNCTION
const CURLOPT_SSH_AUTH_TYPES
const CURLINFO_REDIRECT_URL
const CURLOPT_MAXCONNECTS
const CURLOPT_DEBUGFUNCTION
curl_error(CurlHandle $handle)
const CURLOPT_PROXY_PINNEDPUBLICKEY
const CURLOPT_COOKIESESSION
const CURLOPT_DNS_SHUFFLE_ADDRESSES
const CURLOPT_LOW_SPEED_LIMIT
const CURLOPT_SOCKS5_AUTH
const CURLOPT_SSL_OPTIONS
const CURLOPT_PROXY_SSLKEY
curl_init(?string $url=null)
const CURLOPT_DOH_SSL_VERIFYHOST
const CURLOPT_SSLKEY_BLOB
const CURL_REDIR_POST_ALL
curl_close(CurlHandle $handle)
const CURLOPT_SASL_AUTHZID
const CURLOPT_WRITEHEADER
const CURLOPT_TRANSFERTEXT
const CURLOPT_HTTP_CONTENT_DECODING
const CURLOPT_PROXY_SSL_OPTIONS
const CURLOPT_CAINFO_BLOB
const CURLOPT_TCP_KEEPINTVL
const CURL_VERSION_KERBEROS5
const CURLINFO_APPCONNECT_TIME_T
const CURLOPT_GSSAPI_DELEGATION
const CURLOPT_MAXFILESIZE_LARGE
const CURLOPT_FTP_USE_EPRT
const CURLOPT_CA_CACHE_TIMEOUT
const CURLOPT_PROXY_SSLKEY_BLOB
const CURLOPT_DOH_SSL_VERIFYPEER
const CURLOPT_ALTSVC_CTRL
const CURLOPT_LOCALPORTRANGE
const CURL_VERSION_NTLM_WB
const CURLOPT_HTTP200ALIASES
const CURLOPT_PROXY_TLSAUTH_USERNAME
const CURLOPT_UNIX_SOCKET_PATH
const CURLOPT_FTP_CREATE_MISSING_DIRS
const CURLINFO_EFFECTIVE_URL
const CURLOPT_TCP_KEEPIDLE
const CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
const CURLOPT_TLSAUTH_TYPE
const CURLINFO_NAMELOOKUP_TIME_T
const CURLOPT_SSL_FALSESTART
const CURLOPT_DNS_CACHE_TIMEOUT
const CURLOPT_SSLKEYPASSWD
const CURLOPT_MAXLIFETIME_CONN
const CURL_VERSION_MULTI_SSL
const CURLOPT_PROXY_SSLVERSION
const CURLOPT_RTSP_STREAM_URI
const CURLOPT_RTSP_CLIENT_CSEQ
const CURLOPT_HTTP_TRANSFER_DECODING
const CURLOPT_HEADERFUNCTION
const CURL_VERSION_SPNEGO
const CURLINFO_SPEED_DOWNLOAD
const CURLOPT_FTP_SSL_CCC
const CURLOPT_REDIR_PROTOCOLS_STR
const CURLOPT_TIMECONDITION
const CURLOPT_SSH_PRIVATE_KEYFILE
const CURLOPT_SSLENGINE_DEFAULT
const CURLOPT_FTP_FILEMETHOD
const CURLOPT_SSL_CIPHER_LIST
const CURLOPT_AUTOREFERER
const CURLOPT_WRITEFUNCTION
const CURLOPT_RTSP_REQUEST
const CURLOPT_ADDRESS_SCOPE
const CURLOPT_ACCEPT_ENCODING
const CURLOPT_FORBID_REUSE
const CURLINFO_REQUEST_SIZE
const CURLOPT_SSH_KNOWNHOSTS
const CURL_VERSION_ASYNCHDNS
const CURLINFO_REDIRECT_TIME
const CURLOPT_PINNEDPUBLICKEY
const CURLOPT_FTP_ALTERNATIVE_TO_USER
const CURLOPT_WILDCARDMATCH
const CURLOPT_MIME_OPTIONS
const CURLOPT_TFTP_BLKSIZE
const CURLOPT_DOH_SSL_VERIFYSTATUS
const CURLOPT_PROXY_SSL_VERIFYPEER
const CURL_PREREQFUNC_ABORT
const CURLOPT_CONNECTTIMEOUT
const CURLOPT_STREAM_WEIGHT
const CURLOPT_PROXY_TLSAUTH_PASSWORD
const CURLOPT_UPLOAD_BUFFERSIZE
const CURLOPT_RTSP_SERVER_CSEQ
const CURLOPT_DNS_LOCAL_IP4
const CURLOPT_TLS13_CIPHERS
const CURLOPT_TCP_KEEPALIVE
const CURLOPT_SSLCERT_BLOB
const CURL_VERSION_HTTPS_PROXY
const CURLOPT_PROXYHEADER
const CURLOPT_PROXY_CRLFILE
const CURLOPT_RANDOM_FILE
const CURLINFO_TOTAL_TIME_T
const CURLOPT_PROXY_SSLCERT_BLOB
const CURLOPT_ABSTRACT_UNIX_SOCKET
const CURLINFO_LOCAL_PORT
const CURLOPT_UNRESTRICTED_AUTH
const CURLOPT_MAXAGE_CONN
const CURLOPT_SSH_COMPRESSION
const CURLOPT_MAIL_RCPT_ALLLOWFAILS
curl_exec(CurlHandle $handle)
const CURLOPT_FAILONERROR
const CURLOPT_TCP_NODELAY
const CURLOPT_SSL_EC_CURVES
const CURLOPT_RTSP_TRANSPORT
const CURLOPT_PROXY_SSLKEYTYPE
const CURLOPT_FRESH_CONNECT
const CURLOPT_FTP_SKIP_PASV_IP
curl_escape(CurlHandle $handle, string $string)
const CURLINFO_CONNECT_TIME_T
const CURLOPT_PROXY_KEYPASSWD
const CURLINFO_PRETRANSFER_TIME_T
const CURLOPT_SERVICE_NAME
const CURLOPT_FOLLOWLOCATION
const CURLINFO_REDIRECT_COUNT
const CURLOPT_REQUEST_TARGET
const CURLOPT_HTTP_VERSION
const CURLOPT_PROXY_SSL_VERIFYHOST
const CURLOPT_SSL_VERIFYSTATUS
const CURLINFO_CONTENT_TYPE
const CURLOPT_PROXY_ISSUERCERT_BLOB
const CURLINFO_CONTENT_LENGTH_DOWNLOAD
const CURLOPT_DISALLOW_USERNAME_IN_URL
const CURLOPT_CONNECT_ONLY
const CURLINFO_REDIRECT_TIME_T
const CURLOPT_PROXY_CAINFO_BLOB
const CURLOPT_SOCKS5_GSSAPI_NEC
const CURLINFO_NAMELOOKUP_TIME
const CURLINFO_SPEED_UPLOAD
const CURLOPT_TCP_KEEPCNT
const CURLOPT_NEW_DIRECTORY_PERMS
const CURL_VERSION_GSSNEGOTIATE
const CURLOPT_RTSP_SESSION_ID
const CURLOPT_PROXYPASSWORD
const CURL_VERSION_KERBEROS4
const CURLOPT_NEW_FILE_PERMS
const CURLOPT_HTTP09_ALLOWED
const CURLOPT_XOAUTH2_BEARER
const CURLOPT_MAX_SEND_SPEED_LARGE
const CURLOPT_SSL_VERIFYHOST
const CURLINFO_HEADER_SIZE
const CURLOPT_FTP_USE_PRET
const CURLOPT_DEFAULT_PROTOCOL
const CURLOPT_FTP_ACCOUNT
curl_pause(CurlHandle $handle, int $flags)
PHP_CURL_API zend_class_entry * curl_CURLFile_class
void curlfile_register_class(void)
PHP_CURL_API zend_class_entry * curl_CURLStringFile_class
void curl_share_register_handlers(void)
void curl_multi_register_handlers(void)
#define SAVE_CURL_ERROR(__handle, __err)
#define CURLOPT_SAFE_UPLOAD
struct _php_curlsh php_curlsh
#define Z_CURL_SHARE_P(zv)
#define CURLOPT_BINARYTRANSFER
#define CURLOPT_RETURNTRANSFER
zend_result curl_cast_object(zend_object *obj, zval *result, int type)
memset(ptr, 0, type->size)
PHPAPI int php_check_open_basedir(const char *path)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
zend_class_entry * curl_multi_ce
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
PHP_JSON_API size_t int options
#define PHPWRITE(str, str_len)
unsigned char key[REFLECTION_KEY_LEN]
#define php_stream_cast(stream, as, ret, show_err)
struct _php_stream php_stream
#define php_stream_read(stream, buf, count)
#define php_stream_seek(stream, offset, whence)
#define php_stream_flush(stream)
#define php_stream_close(stream)
#define php_stream_open_wrapper(path, mode, options, opened)
PHPAPI int php_file_le_pstream(void)
#define php_stream_stat(stream, ssb)
#define PHP_STREAM_AS_STDIO
struct _php_stream_statbuf php_stream_statbuf
PHPAPI int php_file_le_stream(void)
php_stream_filter_chain readfilters
zend_fcall_info_cache fnmatch
zend_fcall_info_cache progress
zend_fcall_info_cache debug
php_curl_write * write_header
zend_fcall_info_cache xferinfo
zend_fcall_info_cache fcc
zend_fcall_info_cache fcc
struct _php_curl_free * to_free
php_curl_handlers handlers
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
ZEND_API zval * zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv)
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *class_type)
ZEND_API zval * zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
ZEND_API zend_result add_next_index_string(zval *arg, const char *str)
ZEND_API const zend_fcall_info_cache empty_fcall_info_cache
struct _zend_fcall_info_cache zend_fcall_info_cache
#define ZEND_PARSE_PARAMETERS_END()
#define Z_PARAM_STR_OR_NULL(dest)
#define ZEND_PARSE_PARAMETERS_NONE()
#define ZVAL_STRING(z, s)
#define ZEND_GET_MODULE(name)
#define Z_PARAM_STR(dest)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_LONG(dest)
#define Z_PARAM_LONG_OR_NULL(dest, is_null)
#define ZEND_FCC_INITIALIZED(fcc)
#define Z_PARAM_OBJECT_OF_CLASS(dest, _ce)
#define RETURN_EMPTY_STRING()
#define Z_PARAM_ARRAY(dest)
#define Z_PARAM_ZVAL(dest)
#define ZVAL_STRINGL(z, s, l)
#define RETVAL_STRINGL(s, l)
#define RETURN_STR_COPY(s)
#define ecalloc(nmemb, size)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API ZEND_COLD zend_object * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code)
ZEND_API const char * get_active_function_name(void)
union _zend_function zend_function
ZEND_API zend_get_gc_buffer * zend_get_gc_buffer_create(void)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_FOREACH_VAL(ht, _val)
#define UNREGISTER_INI_ENTRIES()
#define REGISTER_INI_ENTRIES()
#define DISPLAY_INI_ENTRIES()
ZEND_API void * zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type1, int resource_type2)
ZEND_API void zend_llist_add_element(zend_llist *l, const void *element)
ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent)
ZEND_API void zend_llist_clean(zend_llist *l)
void(* llist_dtor_func_t)(void *)
struct _zend_string zend_string
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *writeobj, int type)
ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2)
ZEND_API HashTable * zend_std_get_properties(zend_object *zobj)
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
ZEND_API zend_string *ZEND_FASTCALL zend_long_to_str(zend_long num)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
#define ZEND_ATTRIBUTE_UNUSED
#define XtOffsetOf(s_type, field)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define ZEND_SIZE_T_INT_OVFL(size)
#define zend_string_starts_with_literal_ci(str, prefix)
#define Z_STRVAL_P(zval_p)
#define Z_ARRVAL_P(zval_p)
struct _zend_array HashTable
#define Z_ISNULL_P(zval_p)
#define Z_STRLEN_P(zval_p)
#define Z_OBJCE_P(zval_p)
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
ZEND_API void zval_ptr_dtor(zval *zval_ptr)