projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
gh-actions: fix ci
[m6w6/ext-http]
/
scripts
/
gen_curlinfo.php
diff --git
a/scripts/gen_curlinfo.php
b/scripts/gen_curlinfo.php
index 076a10d10f86bd34e1a354ea5a34b028bb9dc6ed..9fae4cb8d78c6baee7873b89a7a491e1a3c1d22e 100755
(executable)
--- a/
scripts/gen_curlinfo.php
+++ b/
scripts/gen_curlinfo.php
@@
-1,21
+1,18
@@
#!/usr/bin/env php
<?php
#!/usr/bin/env php
<?php
-// $Id: gen_curlinfo.php 323304 2012-02-17 21:13:24Z mike $
error_reporting(0);
function failure() {
error_reporting(0);
function failure() {
- // this is why error_get_last() should return a stdClass object
- $error = error_get_last();
- fprintf(STDERR, "FAILURE: %s\n", $error["message"]);
+ fprintf(STDERR, "FAILURE: %s\n", error_get_last()["message"]);
exit(-1);
}
function file_re($file, $pattern, $all = true) {
static $path;
exit(-1);
}
function file_re($file, $pattern, $all = true) {
static $path;
-
+
$path or $path = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1].'/include/curl/' : "/usr/local/include/curl/";
$path or $path = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1].'/include/curl/' : "/usr/local/include/curl/";
-
+
if ($content = file_get_contents($path . $file)) {
if ($all) {
if (preg_match_all($pattern, $content, $matches, PREG_SET_ORDER)) {
if ($content = file_get_contents($path . $file)) {
if ($all) {
if (preg_match_all($pattern, $content, $matches, PREG_SET_ORDER)) {
@@
-38,11
+35,24
@@
$ifdefs = array(
'PRIMARY_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
'LOCAL_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
'LOCAL_IP' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
'PRIMARY_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
'LOCAL_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
'LOCAL_IP' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
+ 'HTTP_VERSION' => 'PHP_HTTP_CURL_VERSION(7,50,0)',
+ 'PROXY_SSL_VERIFYRESULT' => 'PHP_HTTP_CURL_VERSION(7,52,0)',
+ 'PROTOCOL' => 'PHP_HTTP_CURL_VERSION(7,52,0)',
+ 'SCHEME' => 'PHP_HTTP_CURL_VERSION(7,52,0)',
);
$exclude = array(
);
$exclude = array(
- 'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH', 'CERTINFO', 'TLS_SESSION',
- 'RTSP_SESSION_ID', 'RTSP_CLIENT_CSEQ', 'RTSP_SERVER_CSEQ', 'RTSP_CSEQ_RECV',
- 'COOKIELIST'
+ 'ACTIVESOCKET',
+ 'CERTINFO',
+ 'COOKIELIST',
+ 'FTP_ENTRY_PATH',
+ 'LASTSOCKET',
+ 'PRIVATE',
+ 'RTSP_CLIENT_CSEQ',
+ 'RTSP_CSEQ_RECV',
+ 'RTSP_SERVER_CSEQ',
+ 'RTSP_SESSION_ID',
+ 'TLS_SESSION',
+ 'TLS_SSL_PTR',
);
$translate = array(
);
$translate = array(
@@
-51,31
+61,33
@@
$translate = array(
);
$templates = array(
);
$templates = array(
-'STRING' =>
+'STRING' =>
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &c)) {
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &c)) {
- add_assoc_string_ex(&array, "%s", sizeof("%2$s"), c ? c : "", 1);
+ ZVAL_STRING(&tmp, STR_PTR(c));
+ zend_hash_str_update(info, "%s", lenof("%2$s"), &tmp);
}
',
}
',
-'DOUBLE' =>
+'DOUBLE' =>
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &d)) {
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &d)) {
- add_assoc_double_ex(&array, "%s", sizeof("%2$s"), d);
+ ZVAL_DOUBLE(&tmp, d);
+ zend_hash_str_update(info, "%s", lenof("%2$s"), &tmp);
}
',
}
',
-'LONG' =>
+'LONG' =>
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &l)) {
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &l)) {
- add_assoc_long_ex(&array, "%s", sizeof("%2$s"), l);
+ ZVAL_LONG(&tmp, l);
+ zend_hash_str_update(info, "%s", lenof("%2$s"), &tmp);
}
',
'SLIST' =>
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &s)) {
}
',
'SLIST' =>
' if (CURLE_OK == curl_easy_getinfo(ch, %s, &s)) {
- MAKE_STD_ZVAL(subarray);
- array_init(subarray);
+ array_init(&tmp);
for (p = s; p; p = p->next) {
if (p->data) {
for (p = s; p; p = p->next) {
if (p->data) {
- add_next_index_string(
subarray, p->data, 1
);
+ add_next_index_string(
&tmp, p->data
);
}
}
}
}
-
add_assoc_zval_ex(&array, "%s", sizeof("%2$s"), subarray
);
+
zend_hash_str_update(info, "%s", lenof("%2$s"), &tmp
);
curl_slist_free_all(s);
}
',
curl_slist_free_all(s);
}
',
@@
-92,8
+104,8
@@
foreach ($infos as $info) {
if (isset($ifdefs[$short])) printf("#endif\n");
}
if (isset($ifdefs[$short])) printf("#endif\n");
}
-file_put_contents("
php_http_client_curl.c",
+file_put_contents("
src/php_http_client_curl.c",
preg_replace('/(\/\* BEGIN::CURLINFO \*\/\n).*(\n\s*\/\* END::CURLINFO \*\/)/s', '$1'. ob_get_contents() .'$2',
preg_replace('/(\/\* BEGIN::CURLINFO \*\/\n).*(\n\s*\/\* END::CURLINFO \*\/)/s', '$1'. ob_get_contents() .'$2',
- file_get_contents("php_http_client_curl.c")));
+ file_get_contents("
src/
php_http_client_curl.c")));
?>
?>