From 4adffb737d62b03d209b6c208e43930da60647b1 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Mon, 26 Aug 2024 19:55:31 +0700 Subject: [PATCH] [PHP 8.4][Curl] Add `CURLOPT_PREREQFUNCTION` and constants `CURLOPT_PREREQFUNCTION` is a new Curl option added in PHP 8.4, along with two constants `CURL_PREREQFUNC_ABORT` and `CURL_PREREQFUNC_OK`. - [php/php-src#13255](https://github.com/php/php-src/pull/13255) - [libcurl doc - `CURLOPT_PREREQFUNCTION`](https://curl.se/libcurl/c/CURLOPT_PREREQFUNCTION.html) - [PHP.Watch Codex - `CURLOPT_PREREQFUNCTION`](https://php.watch/codex/CURLOPT_PREREQFUNCTION) - [PHP.Watch Codex - `CURL_PREREQFUNC_ABORT`](https://php.watch/codex/CURL_PREREQFUNC_ABORT) - [PHP.Watch Codex - `CURL_PREREQFUNC_OK`](https://php.watch/codex/CURL_PREREQFUNC_OK) --- PhpStormStubsMap.php | 3 +++ curl/curl_d.php | 15 +++++++++++++++ meta/.phpstorm.meta.php | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/PhpStormStubsMap.php b/PhpStormStubsMap.php index 50c55fb96..5b2213bd7 100644 --- a/PhpStormStubsMap.php +++ b/PhpStormStubsMap.php @@ -6995,6 +6995,7 @@ final class PhpStormStubsMap 'CURLOPT_POSTQUOTE' => 'curl/curl_d.php', 'CURLOPT_POSTREDIR' => 'curl/curl_d.php', 'CURLOPT_PREQUOTE' => 'curl/curl_d.php', + 'CURLOPT_PREREQFUNCTION' => 'curl/curl_d.php', 'CURLOPT_PRE_PROXY' => 'curl/curl_d.php', 'CURLOPT_PRIVATE' => 'curl/curl_d.php', 'CURLOPT_PROGRESSFUNCTION' => 'curl/curl_d.php', @@ -7257,6 +7258,8 @@ final class PhpStormStubsMap 'CURL_NETRC_IGNORED' => 'curl/curl_d.php', 'CURL_NETRC_OPTIONAL' => 'curl/curl_d.php', 'CURL_NETRC_REQUIRED' => 'curl/curl_d.php', + 'CURL_PREREQFUNC_ABORT' => 'curl/curl_d.php', + 'CURL_PREREQFUNC_OK' => 'curl/curl_d.php', 'CURL_PUSH_DENY' => 'curl/curl_d.php', 'CURL_PUSH_OK' => 'curl/curl_d.php', 'CURL_READFUNC_PAUSE' => 'curl/curl_d.php', diff --git a/curl/curl_d.php b/curl/curl_d.php index e68f5cb10..9185d583f 100644 --- a/curl/curl_d.php +++ b/curl/curl_d.php @@ -4343,3 +4343,18 @@ * @since 8.4 */ define('CURL_HTTP_VERSION_3ONLY', 31); + +/** + * @since 8.4 + */ +define('CURLOPT_PREREQFUNCTION', 20312); + +/** + * @since 8.4 + */ +define('CURL_PREREQFUNC_OK', 0); + +/** + * @since 8.4 + */ +define('CURL_PREREQFUNC_ABORT', 1); diff --git a/meta/.phpstorm.meta.php b/meta/.phpstorm.meta.php index 01627ef23..30ef2ed14 100644 --- a/meta/.phpstorm.meta.php +++ b/meta/.phpstorm.meta.php @@ -136,7 +136,7 @@ function argumentsSet($setName) { \CURLOPT_CONNECT_TO, \CURLOPT_HTTP200ALIASES, \CURLOPT_HTTPHEADER, \CURLOPT_POSTQUOTE, \CURLOPT_PROXYHEADER, \CURLOPT_QUOTE, \CURLOPT_RESOLVE, \CURLOPT_HEADERFUNCTION, \CURLOPT_PASSWDFUNCTION, \CURLOPT_PROGRESSFUNCTION, \CURLOPT_READFUNCTION, \CURLOPT_WRITEFUNCTION, \CURLOPT_SHARE, \CURLOPT_FILE, \CURLOPT_INFILE, \CURLOPT_STDERR, \CURLOPT_WRITEHEADER, - \CURLOPT_ACCEPT_ENCODING, \CURLOPT_ADDRESS_SCOPE, \CURLOPT_APPEND, \CURLOPT_CRLFILE, \CURLOPT_DIRLISTONLY, \CURLOPT_DNS_SERVERS, \CURLOPT_FTP_ACCOUNT, \CURLOPT_FTP_ALTERNATIVE_TO_USER, \CURLOPT_FTP_RESPONSE_TIMEOUT, \CURLOPT_FTP_SKIP_PASV_IP, \CURLOPT_FTP_SSL, \CURLOPT_FTP_SSL_CCC, \CURLOPT_FTP_USE_PRET, \CURLOPT_HTTP_TRANSFER_DECODING, \CURLOPT_IGNORE_CONTENT_LENGTH, \CURLOPT_ISSUERCERT, \CURLOPT_KRBLEVEL, \CURLOPT_LOCALPORT, \CURLOPT_LOCALPORTRANGE, \CURLOPT_MAIL_FROM, \CURLOPT_MAIL_RCPT, \CURLOPT_MAXFILESIZE, \CURLOPT_NETRC_FILE, \CURLOPT_NEW_DIRECTORY_PERMS, \CURLOPT_NEW_FILE_PERMS, \CURLOPT_NOPROXY, \CURLOPT_PASSWORD, \CURLOPT_PREQUOTE, \CURLOPT_PROXYPASSWORD, \CURLOPT_PROXYUSERNAME, \CURLOPT_PROXY_TRANSFER_MODE, \CURLOPT_READDATA, \CURLOPT_REQUEST_TARGET, \CURLOPT_RTSP_CLIENT_CSEQ, \CURLOPT_RTSP_REQUEST, \CURLOPT_RTSP_SERVER_CSEQ, \CURLOPT_RTSP_SESSION_ID, \CURLOPT_RTSP_STREAM_URI, \CURLOPT_RTSP_TRANSPORT, \CURLOPT_SOCKS5_GSSAPI_NEC, \CURLOPT_SOCKS5_GSSAPI_SERVICE, \CURLOPT_SSH_KNOWNHOSTS, \CURLOPT_SSL_SESSIONID_CACHE, \CURLOPT_TFTP_BLKSIZE, \CURLOPT_TRANSFER_ENCODING, \CURLOPT_USE_SSL, \CURLOPT_TELNETOPTIONS, \CURLOPT_FNMATCH_FUNCTION, \CURLOPT_WILDCARDMATCH, \CURLOPT_TLSAUTH_PASSWORD, \CURLOPT_TLSAUTH_TYPE, \CURLOPT_TLSAUTH_USERNAME, \CURLOPT_GSSAPI_DELEGATION, \CURLOPT_ACCEPTTIMEOUT_MS, \CURLOPT_MAIL_AUTH); + \CURLOPT_ACCEPT_ENCODING, \CURLOPT_ADDRESS_SCOPE, \CURLOPT_APPEND, \CURLOPT_CRLFILE, \CURLOPT_DIRLISTONLY, \CURLOPT_DNS_SERVERS, \CURLOPT_FTP_ACCOUNT, \CURLOPT_FTP_ALTERNATIVE_TO_USER, \CURLOPT_FTP_RESPONSE_TIMEOUT, \CURLOPT_FTP_SKIP_PASV_IP, \CURLOPT_FTP_SSL, \CURLOPT_FTP_SSL_CCC, \CURLOPT_FTP_USE_PRET, \CURLOPT_HTTP_TRANSFER_DECODING, \CURLOPT_IGNORE_CONTENT_LENGTH, \CURLOPT_ISSUERCERT, \CURLOPT_KRBLEVEL, \CURLOPT_LOCALPORT, \CURLOPT_LOCALPORTRANGE, \CURLOPT_MAIL_FROM, \CURLOPT_MAIL_RCPT, \CURLOPT_MAXFILESIZE, \CURLOPT_NETRC_FILE, \CURLOPT_NEW_DIRECTORY_PERMS, \CURLOPT_NEW_FILE_PERMS, \CURLOPT_NOPROXY, \CURLOPT_PASSWORD, \CURLOPT_PREQUOTE, \CURLOPT_PROXYPASSWORD, \CURLOPT_PROXYUSERNAME, \CURLOPT_PROXY_TRANSFER_MODE, \CURLOPT_READDATA, \CURLOPT_REQUEST_TARGET, \CURLOPT_RTSP_CLIENT_CSEQ, \CURLOPT_RTSP_REQUEST, \CURLOPT_RTSP_SERVER_CSEQ, \CURLOPT_RTSP_SESSION_ID, \CURLOPT_RTSP_STREAM_URI, \CURLOPT_RTSP_TRANSPORT, \CURLOPT_SOCKS5_GSSAPI_NEC, \CURLOPT_SOCKS5_GSSAPI_SERVICE, \CURLOPT_SSH_KNOWNHOSTS, \CURLOPT_SSL_SESSIONID_CACHE, \CURLOPT_TFTP_BLKSIZE, \CURLOPT_TRANSFER_ENCODING, \CURLOPT_USE_SSL, \CURLOPT_TELNETOPTIONS, \CURLOPT_FNMATCH_FUNCTION, \CURLOPT_WILDCARDMATCH, \CURLOPT_TLSAUTH_PASSWORD, \CURLOPT_TLSAUTH_TYPE, \CURLOPT_TLSAUTH_USERNAME, \CURLOPT_GSSAPI_DELEGATION, \CURLOPT_ACCEPTTIMEOUT_MS, \CURLOPT_MAIL_AUTH, \CURLOPT_PREREQFUNCTION); expectedArguments(\curl_setopt(), 2, \CURLAUTH_ANY | \CURLAUTH_ANYSAFE | \CURLAUTH_BASIC | \CURLAUTH_BEARER | \CURLAUTH_DIGEST | \CURLAUTH_GSSAPI | \CURLAUTH_GSSNEGOTIATE | \CURLAUTH_NEGOTIATE | \CURLAUTH_NTLM | \CURLAUTH_NTLM_WB | \CURLSSH_AUTH_AGENT | \CURLSSH_AUTH_GSSAPI, \CURL_SSLVERSION_DEFAULT, \CURL_SSLVERSION_MAX_DEFAULT, \CURL_SSLVERSION_MAX_NONE, \CURL_SSLVERSION_MAX_TLSv1_0, \CURL_SSLVERSION_MAX_TLSv1_1, \CURL_SSLVERSION_MAX_TLSv1_2, \CURL_SSLVERSION_MAX_TLSv1_3, \CURL_SSLVERSION_SSLv2, \CURL_SSLVERSION_SSLv3, \CURL_SSLVERSION_TLSv1, \CURL_SSLVERSION_TLSv1_0, \CURL_SSLVERSION_TLSv1_1, \CURL_SSLVERSION_TLSv1_2, \CURL_SSLVERSION_TLSv1_3, \CURLFTPAUTH_DEFAULT, \CURLFTPAUTH_SSL, \CURLFTPAUTH_TLS, \CURLFTPMETHOD_MULTICWD, \CURLFTPMETHOD_NOCWD, \CURLFTPMETHOD_SINGLECWD, \CURLFTPSSL_ALL, \CURLFTPSSL_CONTROL, \CURLFTPSSL_NONE, \CURLFTPSSL_TRY, \CURLFTP_CREATE_DIR, \CURLFTP_CREATE_DIR_NONE, \CURLFTP_CREATE_DIR_RETRY, \CURLPROTO_ALL | \CURLPROTO_DICT | \CURLPROTO_FILE | \CURLPROTO_FTP | \CURLPROTO_FTPS | \CURLPROTO_HTTPS | \CURLPROTO_LDAP | \CURLPROTO_LDAPS | \CURLPROTO_SCP | \CURLPROTO_SFTP | \CURLPROTO_SMB | \CURLPROTO_SMBS | \CURLPROTO_TELNET | \CURLPROTO_TFTP, \CURLPROXY_HTTP, \CURLPROXY_HTTPS, \CURLPROXY_HTTP_1_0, \CURLPROXY_SOCKS4, \CURLPROXY_SOCKS5,