Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
17 / 17 |
|
100.00% |
17 / 17 |
CRAP | |
100.00% |
1 / 1 |
Options | |
100.00% |
17 / 17 |
|
100.00% |
17 / 17 |
18 | |
100.00% |
1 / 1 |
isValidOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
isCommandOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isPhpOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isValueOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isBooleanOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCommandOptions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCommandOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPhpOptions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPhpOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getValueOptions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getValueOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getOptionValueByName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getOptionNameByValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
hasOptionValueByName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
hasOptionNameByValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getOmitOptions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isOmitOption | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Http\Client\Handler\Curl; |
15 | |
16 | /** |
17 | * HTTP client curl options class |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Http |
21 | * @author Nick Sagona, III <dev@nolainteractive.com> |
22 | * @copyright Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
23 | * @license http://www.popphp.org/license New BSD License |
24 | * @version 5.2.0 |
25 | */ |
26 | class Options |
27 | { |
28 | |
29 | /** |
30 | * Curl CLI-to-PHP options |
31 | * @var array |
32 | */ |
33 | protected static array $commandOptions = [ |
34 | '--abstract-unix-socket' => 'CURLOPT_ABSTRACT_UNIX_SOCKET', // --abstract-unix-socket <path> |
35 | '--alt-svc' => 'CURLOPT_ALTSVC', // --alt-svc <filename> |
36 | '-a' => 'CURLOPT_APPEND', |
37 | '--aws-sigv4' => 'CURLOPT_AWS_SIGV4', // --aws-sigv4 <provider1[:provider2[:region[:service]]]> |
38 | '--cacert' => 'CURLOPT_CAINFO', // --cacert <file> |
39 | '--capath' => 'CURLOPT_CAPATH', // --capath <dir> |
40 | '--connect-timeout' => ['CURLOPT_TIMEOUT', 'CURLOPT_CONNECTTIMEOUT', 'CURLOPT_TIMEOUT'], // --connect-timeout <fractional seconds> (MS needs to be converted to seconds) |
41 | '--connect-to' => 'CURLOPT_CONNECT_TO', // --connect-to <HOST1:PORT1:HOST2:PORT2> |
42 | '-b' => 'CURLOPT_COOKIE', // -b, --cookie <data|filename> |
43 | '--cookie' => 'CURLOPT_COOKIE', // -b, --cookie <data|filename> |
44 | '-c' => 'CURLOPT_COOKIEJAR', // -c, --cookie-jar <filename> |
45 | '--cookie-jar' => 'CURLOPT_COOKIEJAR', // -c, --cookie-jar <filename> |
46 | '--crlf' => 'CURLOPT_CRLF', |
47 | '--crlfile' => 'CURLOPT_CRLFILE', // --crlfile <file> |
48 | '-X' => ['CURLOPT_POST', 'CURLOPT_PUT', 'CURLOPT_CUSTOMREQUEST'], // -X, --request <method> |
49 | '--request' => ['CURLOPT_POST', 'CURLOPT_PUT', 'CURLOPT_CUSTOMREQUEST'], // -X, --request <method> |
50 | '--disallow-username-in-url' => 'CURLOPT_DISALLOW_USERNAME_IN_URL', |
51 | '--dns-interface' => 'CURLOPT_DNS_INTERFACE', // --dns-interface <interface> |
52 | '--dns-ipv4-addr' => 'CURLOPT_DNS_LOCAL_IP4', // --dns-ipv4-addr <address> |
53 | '--dns-ipv6-addr' => 'CURLOPT_DNS_LOCAL_IP6', // --dns-ipv6-addr <address> |
54 | '--dns-servers' => 'CURLOPT_DNS_SERVERS', // --dns-servers <addresses> |
55 | '--doh-insecure' => ['CURLOPT_DOH_SSL_VERIFYPEER', 'CURLOPT_DOH_SSL_VERIFYHOST'], // Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name and certificate. Available as of PHP 8.2.0 and cURL 7.76.0. |
56 | '--no-doh-insecure' => ['CURLOPT_DOH_SSL_VERIFYPEER', 'CURLOPT_DOH_SSL_VERIFYHOST'], // Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name and certificate. Available as of PHP 8.2.0 and cURL 7.76.0. |
57 | '--doh-cert-status' => 'CURLOPT_DOH_SSL_VERIFYSTATUS', // Tell cURL to verify the status of the DNS-over-HTTPS server certificate using the "Certificate Status Request" TLS extension (OCSP stapling). Available as of PHP 8.2.0 and cURL 7.76.0. |
58 | '--doh-url' => 'CURLOPT_DOH_URL', // --doh-url <url> Provides the DNS-over-HTTPS URL. Available as of PHP 8.1.0 and cURL 7.62.0. |
59 | '--expect100-timeout' => 'CURLOPT_EXPECT_100_TIMEOUT_MS', // --expect100-timeout <seconds> |
60 | '-P' => 'CURLOPT_FTPPORT', // -P, --ftp-port <address> |
61 | '--ftp-port' => 'CURLOPT_FTPPORT', // -P, --ftp-port <address> |
62 | '--ftp-account' => 'CURLOPT_FTP_ACCOUNT', // --ftp-account <data> |
63 | '--ftp-alternative-to-user' => 'CURLOPT_FTP_ALTERNATIVE_TO_USER', // --ftp-alternative-to-user <command> |
64 | '--ftp-create-dirs' => 'CURLOPT_FTP_CREATE_MISSING_DIRS', |
65 | '--ftp-method' => 'CURLOPT_FTP_FILEMETHOD', // --ftp-method <method> |
66 | '--ftp-pasv' => 'CURLOPT_FTP_SKIP_PASV_IP', |
67 | '--ftp-skip-pasv-ip' => 'CURLOPT_FTP_SKIP_PASV_IP', |
68 | '--ftp-ssl-ccc' => 'CURLOPT_FTP_SSL_CCC', |
69 | '--disable-eprt' => 'CURLOPT_FTP_USE_EPRT', |
70 | '--disable-epsv' => 'CURLOPT_FTP_USE_EPSV', |
71 | '--ftp-pret' => 'CURLOPT_FTP_USE_PRET', |
72 | '--delegation' => 'CURLOPT_GSSAPI_DELEGATION', // --delegation <level> |
73 | '--happy-eyeballs-timeout-ms' => 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS', // --happy-eyeballs-timeout-ms <milliseconds> |
74 | '--haproxy-protocol' => 'CURLOPT_HAPROXYPROTOCOL', |
75 | '-i' => 'CURLOPT_HEADER', |
76 | '--include' => 'CURLOPT_HEADER', |
77 | '--hsts' => 'CURLOPT_HSTS', // --hsts <filename> |
78 | '--http0.9' => 'CURLOPT_HTTP09_ALLOWED', |
79 | '-H' => 'CURLOPT_HTTPHEADER', // -H, --header <header/@file> |
80 | '--header' => 'CURLOPT_HTTPHEADER', // -H, --header <header/@file> |
81 | '-p' => 'CURLOPT_HTTPPROXYTUNNEL', |
82 | '--proxytunnel' => 'CURLOPT_HTTPPROXYTUNNEL', |
83 | '-0' => 'CURLOPT_HTTP_VERSION', |
84 | '--http1.0' => 'CURLOPT_HTTP_VERSION', |
85 | '--http1.1' => 'CURLOPT_HTTP_VERSION', |
86 | '--http2' => 'CURLOPT_HTTP_VERSION', |
87 | '--ignore-content-length' => 'CURLOPT_IGNORE_CONTENT_LENGTH', |
88 | '-T' => 'CURLOPT_INFILE', // -T, --upload-file <file> (Used with PUT) |
89 | '--upload-file' => 'CURLOPT_INFILE', // -T, --upload-file <file> (Used with PUT) |
90 | '--interface' => 'CURLOPT_INTERFACE', // --interface <name> |
91 | '--krb' => 'CURLOPT_KRBLEVEL', // --krb <level> |
92 | '--local-port' => ['CURLOPT_LOCALPORT', 'CURLOPT_LOCALPORTRANGE'], // --local-port <num/range> |
93 | '--login-options' => 'CURLOPT_LOGIN_OPTIONS', // --login-options <options> |
94 | '-Y' => 'CURLOPT_LOW_SPEED_LIMIT', // -Y, --speed-limit <speed> |
95 | '--speed-limit' => 'CURLOPT_LOW_SPEED_LIMIT', // -Y, --speed-limit <speed> |
96 | '-y' => 'CURLOPT_LOW_SPEED_TIME', // -y, --speed-time <seconds> |
97 | '--speed-time' => 'CURLOPT_LOW_SPEED_TIME', // -y, --speed-time <seconds> |
98 | '--mail-auth' => 'CURLOPT_MAIL_AUTH', // --mail-auth <address> |
99 | '--mail-from' => 'CURLOPT_MAIL_FROM', // --mail-from <address> |
100 | '--mail-rcpt' => 'CURLOPT_MAIL_RCPT', // --mail-rcpt <address> |
101 | '--mail-rcpt-allowfails' => 'CURLOPT_MAIL_RCPT_ALLLOWFAILS', |
102 | '--max-filesize' => 'CURLOPT_MAXFILESIZE', // --max-filesize <bytes> |
103 | '-m' => 'CURLOPT_MAXLIFETIME_CONN', // -m, --max-time <fractional seconds> |
104 | '--max-time' => 'CURLOPT_MAXLIFETIME_CONN', // -m, --max-time <fractional seconds> |
105 | '--max-redirs' => 'CURLOPT_MAXREDIRS', // --max-redirs <num> |
106 | '-n' => 'CURLOPT_NETRC', |
107 | '--netrc' => 'CURLOPT_NETRC', |
108 | '--netrc-file' => 'CURLOPT_NETRC_FILE', // --netrc-file <filename> |
109 | '--no-progress-meter' => 'CURLOPT_NOPROGRESS', |
110 | '--noproxy' => 'CURLOPT_NOPROXY', // --noproxy <no-proxy-list> |
111 | '-u' => ['CURLOPT_USERPWD', 'CURLOPT_USERNAME', 'CURLOPT_PASSWORD'], // -u, --user <user:password> |
112 | '--user' => ['CURLOPT_USERPWD', 'CURLOPT_USERNAME', 'CURLOPT_PASSWORD'], // -u, --user <user:password> |
113 | '-d' => 'CURLOPT_POSTFIELDS', // -d, --data <data> |
114 | '-data' => 'CURLOPT_POSTFIELDS', // -d, --data <data> |
115 | '-x' => 'CURLOPT_PROXY', // -x, --proxy [protocol://]host[:port] |
116 | '--proxy' => 'CURLOPT_PROXY', // -x, --proxy [protocol://]host[:port] |
117 | '--proxy-basic' => 'CURLOPT_PROXYAUTH', |
118 | '--proxy-digest' => 'CURLOPT_PROXYAUTH', |
119 | '--proxy-header' => 'CURLOPT_PROXYHEADER', // --proxy-header <header/@file> |
120 | '-U' => 'CURLOPT_PROXYUSERPWD', // -U, --proxy-user <user:password> |
121 | '--proxy-user' => 'CURLOPT_PROXYUSERPWD', // -U, --proxy-user <user:password> |
122 | '--proxy-cacert' => 'CURLOPT_PROXY_CAINFO', // --proxy-cacert <file> |
123 | '--proxy-capath' => 'CURLOPT_PROXY_CAPATH', // --proxy-capath <dir> |
124 | '--proxy-crlfile' => 'CURLOPT_PROXY_CRLFILE', // --proxy-crlfile <file> |
125 | '--proxy-pass' => 'CURLOPT_PROXY_KEYPASSWD', // --proxy-pass <phrase> |
126 | '--proxy-pinnedpubkey' => 'CURLOPT_PROXY_PINNEDPUBLICKEY', // --proxy-pinnedpubkey <hashes> |
127 | '--proxy-service-name' => 'CURLOPT_PROXY_SERVICE_NAME', // --proxy-service-name <name> |
128 | '--proxy-cert' => 'CURLOPT_PROXY_SSLCERT', // --proxy-cert <cert[:passwd]> |
129 | '--proxy-cert-type' => 'CURLOPT_PROXY_SSLCERTTYPE', // --proxy-cert-type <type> |
130 | '--proxy-key' => 'CURLOPT_PROXY_SSLKEY', // --proxy-key <key> |
131 | '--proxy-key-type' => 'CURLOPT_PROXY_SSLKEYTYPE', // --proxy-key-type <type> |
132 | '--proxy-ciphers' => 'CURLOPT_PROXY_SSL_CIPHER_LIST', // --proxy-ciphers <list> |
133 | '--proxy-insecure' => ['CURLOPT_PROXY_SSL_VERIFYHOST', 'CURLOPT_PROXY_SSL_VERIFYPEER'], |
134 | '--proxy-tls13-ciphers' => 'CURLOPT_PROXY_TLS13_CIPHERS', // --proxy-tls13-ciphers <ciphersuite list> |
135 | '--proxy-tlspassword' => 'CURLOPT_PROXY_TLSAUTH_PASSWORD', // --proxy-tlspassword <string> |
136 | '--proxy-tlsauthtype' => 'CURLOPT_PROXY_TLSAUTH_TYPE', // --proxy-tlsauthtype <type> |
137 | '--proxy-tlsuser' => 'CURLOPT_PROXY_TLSAUTH_USERNAME', // --proxy-tlsuser <name> |
138 | '-Q' => 'CURLOPT_QUOTE', // -Q, --quote <command> |
139 | '--quote' => 'CURLOPT_QUOTE', // -Q, --quote <command> |
140 | '--random-file' => 'CURLOPT_RANDOM_FILE', // --random-file <file> |
141 | '-r' => 'CURLOPT_RANGE', // -r, --range <range> |
142 | '--range' => 'CURLOPT_RANGE', // -r, --range <range> |
143 | '-e' => 'CURLOPT_REFERER', // -e, --referer <url> |
144 | '--referer' => 'CURLOPT_REFERER', // -e, --referer <url> |
145 | '--resolve' => 'CURLOPT_RESOLVE', // --resolve <[+]host:port:addr[,addr]...> |
146 | '--sasl-authzid' => 'CURLOPT_SASL_AUTHZID', // --sasl-authzid <identity> |
147 | '--sasl-ir' => 'CURLOPT_SASL_IR', |
148 | '--service-name' => 'CURLOPT_SERVICE_NAME', // --service-name <name> |
149 | '--socks5-basic' => 'CURLOPT_SOCKS5_AUTH', |
150 | '--socks5-gssapi-nec' => 'CURLOPT_SOCKS5_GSSAPI_NEC', |
151 | '--socks5-gssapi-service' => 'CURLOPT_SOCKS5_GSSAPI_SERVICE', // --socks5-gssapi-service <name> |
152 | '--compressed-ssh' => 'CURLOPT_SSH_COMPRESSION', |
153 | '--hostpubmd5' => 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5', // --hostpubmd5 <md5> |
154 | '--hostpubsha256' => 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256', // --hostpubsha256 <sha256> |
155 | '--pubkey' => 'CURLOPT_SSH_PUBLIC_KEYFILE', // --pubkey <key> |
156 | '-E' => 'CURLOPT_SSLCERT', // -E, --cert <certificate[:password]> |
157 | '--cert' => 'CURLOPT_SSLCERT', // -E, --cert <certificate[:password]> |
158 | '--cert-type' => 'CURLOPT_SSLCERTTYPE', // --cert-type <type> |
159 | '--engine' => 'CURLOPT_SSLENGINE', // --engine <name> |
160 | '--key' => 'CURLOPT_SSLKEY', // --key <key> |
161 | '--pass' => 'CURLOPT_SSLKEYPASSWD', // --pass <phrase> |
162 | '--key-type' => 'CURLOPT_SSLKEYTYPE', // --key-type <type> |
163 | '-2' => 'CURLOPT_SSLVERSION', |
164 | '--sslv2' => 'CURLOPT_SSLVERSION', |
165 | '-3' => 'CURLOPT_SSLVERSION', |
166 | '--sslv3' => 'CURLOPT_SSLVERSION', |
167 | '--ciphers' => 'CURLOPT_SSL_CIPHER_LIST', // --ciphers <list of ciphers> i.e. ECDHE-ECDSA-AES256-CCM8 |
168 | '--curves' => 'CURLOPT_SSL_EC_CURVES', // --curves <algorithm list> |
169 | '--alpn' => 'CURLOPT_SSL_ENABLE_ALPN', |
170 | '--no-alpn' => 'CURLOPT_SSL_ENABLE_ALPN', |
171 | '--npn' => 'CURLOPT_SSL_ENABLE_NPN', |
172 | '--no-npn' => 'CURLOPT_SSL_ENABLE_NPN', |
173 | '--false-start' => 'CURLOPT_SSL_FALSESTART', |
174 | '--no-sessionid' => 'CURLOPT_SSL_SESSIONID_CACHE', |
175 | '-k' => ['CURLOPT_SSL_VERIFYHOST', 'CURLOPT_SSL_VERIFYPEER'], |
176 | '--insecure' => ['CURLOPT_SSL_VERIFYHOST', 'CURLOPT_SSL_VERIFYPEER'], |
177 | '--cert-status' => 'CURLOPT_SSL_VERIFYSTATUS', |
178 | '--stderr' => 'CURLOPT_STDERR', // --stderr <file> |
179 | '--suppress-connect-headers' => 'CURLOPT_SUPPRESS_CONNECT_HEADERS', |
180 | '--tcp-fastopen' => 'CURLOPT_TCP_FASTOPEN', |
181 | '--keepalive-time' => 'CURLOPT_TCP_KEEPALIVE', // --keepalive-time <seconds> |
182 | '--tcp-nodelay' => 'CURLOPT_TCP_NODELAY', |
183 | '-t' => 'CURLOPT_TELNETOPTIONS', // -t, --telnet-option <opt=val> |
184 | '--telnet-option' => 'CURLOPT_TELNETOPTIONS', // -t, --telnet-option <opt=val> |
185 | '--tftp-blksize' => 'CURLOPT_TFTP_BLKSIZE', // --tftp-blksize <value> |
186 | '--tftp-no-options' => 'CURLOPT_TFTP_NO_OPTIONS', |
187 | '-z --time-cond' => 'CURLOPT_TIMECONDITION', // -z, --time-cond <time> |
188 | '--tls13-ciphers' => 'CURLOPT_TLS13_CIPHERS', // --tls13-ciphers <ciphersuite list> |
189 | '--tlspassword' => 'CURLOPT_TLSAUTH_PASSWORD', // --tlspassword <string> |
190 | '--tlsauthtype' => 'CURLOPT_TLSAUTH_TYPE', // --tlsauthtype <type> |
191 | '--tlsuser' => 'CURLOPT_TLSAUTH_USERNAME', // --tlsuser <name> |
192 | '--tr-encoding' => 'CURLOPT_TRANSFER_ENCODING', |
193 | '--no-tr-encoding' => 'CURLOPT_TRANSFER_ENCODING', |
194 | '--unix-socket' => 'CURLOPT_UNIX_SOCKET_PATH', // --unix-socket <path> |
195 | '--url' => 'CURLOPT_URL', // --url <url> (Used for config files, unnecessary on the CLI) |
196 | '-A' => 'CURLOPT_USERAGENT', // -A, --user-agent <name> |
197 | '--user-agent' => 'CURLOPT_USERAGENT', // -A, --user-agent <name> |
198 | '--ssl' => 'CURLOPT_USE_SSL', // Attempts to force server to use secure connection', |
199 | '--ssl-reqd' => 'CURLOPT_USE_SSL', // Attempts to force server to use secure connection', |
200 | '-v' => 'CURLOPT_VERBOSE', |
201 | '--verbose' => 'CURLOPT_VERBOSE', |
202 | '--oauth2-bearer' => 'CURLOPT_XOAUTH2_BEARER', // --oauth2-bearer <token> |
203 | '--ssl-allow-beast' => 'CURLSSLOPT_ALLOW_BEAST', |
204 | '--ssl-auto-client-cert' => 'CURLSSLOPT_AUTO_CLIENT_CERT', |
205 | '--ssl-no-revoke' => 'CURLSSLOPT_NO_REVOKE', |
206 | '--ssl-revoke-best-effort' => 'CURLSSLOPT_REVOKE_BEST_EFFORT', |
207 | ]; |
208 | |
209 | /** |
210 | * Curl PHP-to-CLI options |
211 | * @var array |
212 | */ |
213 | protected static array $phpOptions = [ |
214 | 'CURLOPT_ABSTRACT_UNIX_SOCKET' => '--abstract-unix-socket', // --abstract-unix-socket <path> |
215 | 'CURLOPT_ALTSVC' => '--alt-svc', // --alt-svc <filename> |
216 | 'CURLOPT_APPEND' => '-a', |
217 | 'CURLOPT_AWS_SIGV4' => '--aws-sigv4', // --aws-sigv4 <provider1[:provider2[:region[:service]]]> |
218 | 'CURLOPT_CAINFO' => '--cacert', // --cacert <file> |
219 | 'CURLOPT_CAPATH' => '--capath', // --capath <dir> |
220 | 'CURLOPT_CONNECTTIMEOUT' => '--connect-timeout', // --connect-timeout <fractional seconds> |
221 | 'CURLOPT_CONNECT_TO' => '--connect-to', // --connect-to <HOST1:PORT1:HOST2:PORT2> |
222 | 'CURLOPT_COOKIE' => ['-b', '--cookie'], // -b, --cookie <data|filename> |
223 | 'CURLOPT_COOKIEJAR' => ['-c', '--cookie-jar'], // -c, --cookie-jar <filename> |
224 | 'CURLOPT_CRLF' => '--crlf', |
225 | 'CURLOPT_CRLFILE' => '--crlfile', // --crlfile <file> |
226 | 'CURLOPT_CUSTOMREQUEST' => ['-X', '--request'], // -X, --request <method> |
227 | 'CURLOPT_DISALLOW_USERNAME_IN_URL' => '--disallow-username-in-url', |
228 | 'CURLOPT_DNS_INTERFACE' => '--dns-interface', // --dns-interface <interface> |
229 | 'CURLOPT_DNS_LOCAL_IP4' => '--dns-ipv4-addr', // --dns-ipv4-addr <address> |
230 | 'CURLOPT_DNS_LOCAL_IP6' => '--dns-ipv6-addr', // --dns-ipv6-addr <address> |
231 | 'CURLOPT_DNS_SERVERS' => '--dns-servers', // --dns-servers <addresses> |
232 | 'CURLOPT_DOH_SSL_VERIFYHOST' => ['--doh-insecure', '--no-doh-insecure'], // Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name. Available as of PHP 8.2.0 and cURL 7.76.0. |
233 | 'CURLOPT_DOH_SSL_VERIFYPEER' => ['--doh-insecure', '--no-doh-insecure'], // Verify the authenticity of the DNS-over-HTTPS server's SSL certificate. Available as of PHP 8.2.0 and cURL 7.76.0. |
234 | 'CURLOPT_DOH_SSL_VERIFYSTATUS' => '--doh-cert-status', // Tell cURL to verify the status of the DNS-over-HTTPS server certificate using the "Certificate Status Request" TLS extension (OCSP stapling). Available as of PHP 8.2.0 and cURL 7.76.0. |
235 | 'CURLOPT_DOH_URL' => '--doh-url', // --doh-url <url> Provides the DNS-over-HTTPS URL. Available as of PHP 8.1.0 and cURL 7.62.0. |
236 | 'CURLOPT_EXPECT_100_TIMEOUT_MS' => '--expect100-timeout', // --expect100-timeout <seconds> |
237 | 'CURLOPT_FTPPORT' => ['-P', '--ftp-port'], // -P, --ftp-port <address> |
238 | 'CURLOPT_FTP_ACCOUNT' => '--ftp-account', // --ftp-account <data> |
239 | 'CURLOPT_FTP_ALTERNATIVE_TO_USER' => '--ftp-alternative-to-user', // --ftp-alternative-to-user <command> |
240 | 'CURLOPT_FTP_CREATE_MISSING_DIRS' => '--ftp-create-dirs', |
241 | 'CURLOPT_FTP_FILEMETHOD' => '--ftp-method', // --ftp-method <method> |
242 | 'CURLOPT_FTP_SKIP_PASV_IP' => ['--ftp-skip-pasv-ip', '--ftp-pasv'], |
243 | 'CURLOPT_FTP_SSL_CCC' => '--ftp-ssl-ccc', |
244 | 'CURLOPT_FTP_USE_EPRT' => '--disable-eprt', |
245 | 'CURLOPT_FTP_USE_EPSV' => '--disable-epsv', |
246 | 'CURLOPT_FTP_USE_PRET' => '--ftp-pret', |
247 | 'CURLOPT_GSSAPI_DELEGATION' => '--delegation', // --delegation <level> |
248 | 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS' => '--happy-eyeballs-timeout-ms', // --happy-eyeballs-timeout-ms <milliseconds> |
249 | 'CURLOPT_HAPROXYPROTOCOL' => '--haproxy-protocol', |
250 | 'CURLOPT_HEADER' => ['-i', '--include'], |
251 | 'CURLOPT_HSTS' => '--hsts', // --hsts <filename> |
252 | 'CURLOPT_HTTP09_ALLOWED' => '--http0.9', |
253 | 'CURLOPT_HTTPHEADER' => ['-H', '--header'], // -H, --header <header/@file> |
254 | 'CURLOPT_HTTPPROXYTUNNEL' => ['-p', '--proxytunnel'], |
255 | 'CURLOPT_HTTP_VERSION' => ['-0', '--http1.0', '--http1.1', '--http2'], |
256 | 'CURLOPT_IGNORE_CONTENT_LENGTH' => '--ignore-content-length', |
257 | 'CURLOPT_INFILE' => ['-T', '--upload-file'], // -T, --upload-file <file> (Used with PUT) |
258 | 'CURLOPT_INTERFACE' => '--interface', // --interface <name> |
259 | 'CURLOPT_KRBLEVEL' => '--krb', // --krb <level> |
260 | 'CURLOPT_LOCALPORT' => '--local-port', // --local-port <num/range> |
261 | 'CURLOPT_LOCALPORTRANGE' => '--local-port', // --local-port <num/range> |
262 | 'CURLOPT_LOGIN_OPTIONS' => '--login-options', // --login-options <options> |
263 | 'CURLOPT_LOW_SPEED_LIMIT' => ['-Y', '--speed-limit'], // -Y, --speed-limit <speed> |
264 | 'CURLOPT_LOW_SPEED_TIME' => ['-y', '--speed-time'], // -y, --speed-time <seconds> |
265 | 'CURLOPT_MAIL_AUTH' => '--mail-auth', // --mail-auth <address> |
266 | 'CURLOPT_MAIL_FROM' => '--mail-from', // --mail-from <address> |
267 | 'CURLOPT_MAIL_RCPT' => '--mail-rcpt', // --mail-rcpt <address> |
268 | 'CURLOPT_MAIL_RCPT_ALLLOWFAILS' => '--mail-rcpt-allowfails', |
269 | 'CURLOPT_MAXFILESIZE' => '--max-filesize', // --max-filesize <bytes> |
270 | 'CURLOPT_MAXLIFETIME_CONN' => ['-m', '--max-time'], // -m, --max-time <fractional seconds> |
271 | 'CURLOPT_MAXREDIRS' => '--max-redirs', // --max-redirs <num> |
272 | 'CURLOPT_NETRC' => ['-n', '--netrc'], |
273 | 'CURLOPT_NETRC_FILE' => '--netrc-file', // --netrc-file <filename> |
274 | 'CURLOPT_NOPROGRESS' => '--no-progress-meter', |
275 | 'CURLOPT_NOPROXY' => '--noproxy', // --noproxy <no-proxy-list> |
276 | 'CURLOPT_PASSWORD' => ['-u', '--user'], // -u, --user <user:password> |
277 | 'CURLOPT_POST' => ['-X', '--request'], // -X, --request <method> |
278 | 'CURLOPT_POSTFIELDS' => ['-d', '-data'], // -d, --data <data> |
279 | 'CURLOPT_PROXY' => ['-x', '--proxy'], // -x, --proxy [protocol://]host[:port] |
280 | 'CURLOPT_PROXYAUTH' => ['--proxy-basic', '--proxy-digest'], |
281 | 'CURLOPT_PROXYHEADER' => '--proxy-header', // --proxy-header <header/@file> |
282 | 'CURLOPT_PROXYUSERPWD' => ['-U', '--proxy-user'], // -U, --proxy-user <user:password> |
283 | 'CURLOPT_PROXY_CAINFO' => '--proxy-cacert', // --proxy-cacert <file> |
284 | 'CURLOPT_PROXY_CAPATH' => '--proxy-capath', // --proxy-capath <dir> |
285 | 'CURLOPT_PROXY_CRLFILE' => '--proxy-crlfile', // --proxy-crlfile <file> |
286 | 'CURLOPT_PROXY_KEYPASSWD' => '--proxy-pass', // --proxy-pass <phrase> |
287 | 'CURLOPT_PROXY_PINNEDPUBLICKEY' => '--proxy-pinnedpubkey', // --proxy-pinnedpubkey <hashes> |
288 | 'CURLOPT_PROXY_SERVICE_NAME' => '--proxy-service-name', // --proxy-service-name <name> |
289 | 'CURLOPT_PROXY_SSLCERT' => '--proxy-cert', // --proxy-cert <cert[:passwd]> |
290 | 'CURLOPT_PROXY_SSLCERTTYPE' => '--proxy-cert-type', // --proxy-cert-type <type> |
291 | 'CURLOPT_PROXY_SSLKEY' => '--proxy-key', // --proxy-key <key> |
292 | 'CURLOPT_PROXY_SSLKEYTYPE' => '--proxy-key-type', // --proxy-key-type <type> |
293 | 'CURLOPT_PROXY_SSL_CIPHER_LIST' => '--proxy-ciphers', // --proxy-ciphers <list> |
294 | 'CURLOPT_PROXY_SSL_VERIFYHOST' => '--proxy-insecure', |
295 | 'CURLOPT_PROXY_SSL_VERIFYPEER' => '--proxy-insecure', |
296 | 'CURLOPT_PROXY_TLS13_CIPHERS' => '--proxy-tls13-ciphers', // --proxy-tls13-ciphers <ciphersuite list> |
297 | 'CURLOPT_PROXY_TLSAUTH_PASSWORD' => '--proxy-tlspassword', // --proxy-tlspassword <string> |
298 | 'CURLOPT_PROXY_TLSAUTH_TYPE' => '--proxy-tlsauthtype', // --proxy-tlsauthtype <type> |
299 | 'CURLOPT_PROXY_TLSAUTH_USERNAME' => '--proxy-tlsuser', // --proxy-tlsuser <name> |
300 | 'CURLOPT_PUT' => ['-X', '--request'], // -X, --request <method> |
301 | 'CURLOPT_QUOTE' => ['-Q', '--quote'], // -Q, --quote <command> |
302 | 'CURLOPT_RANDOM_FILE' => '--random-file', // --random-file <file> |
303 | 'CURLOPT_RANGE' => '-r --range', // -r, --range <range> |
304 | 'CURLOPT_REFERER' => '-e --referer', // -e, --referer <url> |
305 | 'CURLOPT_RESOLVE' => '--resolve', // --resolve <[+]host:port:addr[,addr]...> |
306 | 'CURLOPT_SASL_AUTHZID' => '--sasl-authzid', // --sasl-authzid <identity> |
307 | 'CURLOPT_SASL_IR' => '--sasl-ir', |
308 | 'CURLOPT_SERVICE_NAME' => '--service-name', // --service-name <name> |
309 | 'CURLOPT_SOCKS5_AUTH' => '--socks5-basic', |
310 | 'CURLOPT_SOCKS5_GSSAPI_NEC' => '--socks5-gssapi-nec', |
311 | 'CURLOPT_SOCKS5_GSSAPI_SERVICE' => '--socks5-gssapi-service', // --socks5-gssapi-service <name> |
312 | 'CURLOPT_SSH_COMPRESSION' => '--compressed-ssh', |
313 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5' => '--hostpubmd5', // --hostpubmd5 <md5> |
314 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256' => '--hostpubsha256', // --hostpubsha256 <sha256> |
315 | 'CURLOPT_SSH_PUBLIC_KEYFILE' => '--pubkey', // --pubkey <key> |
316 | 'CURLOPT_SSLCERT' => ['-E', '--cert'], // -E, --cert <certificate[:password]> |
317 | 'CURLOPT_SSLCERTTYPE' => '--cert-type', // --cert-type <type> |
318 | 'CURLOPT_SSLENGINE' => '--engine', // --engine <name> |
319 | 'CURLOPT_SSLKEY' => '--key', // --key <key> |
320 | 'CURLOPT_SSLKEYPASSWD' => '--pass', // --pass <phrase> |
321 | 'CURLOPT_SSLKEYTYPE' => '--key-type', // --key-type <type> |
322 | 'CURLOPT_SSLVERSION' => ["-2", "--sslv2", "-3", "--sslv3"], |
323 | 'CURLOPT_SSL_CIPHER_LIST' => '--ciphers', // --ciphers <list of ciphers> i.e. ECDHE-ECDSA-AES256-CCM8 |
324 | 'CURLOPT_SSL_EC_CURVES' => '--curves', // --curves <algorithm list> |
325 | 'CURLOPT_SSL_ENABLE_ALPN' => ['--alpn', '--no-alpn'], |
326 | 'CURLOPT_SSL_ENABLE_NPN' => ['--npn', '--no-npn'], |
327 | 'CURLOPT_SSL_FALSESTART' => '--false-start', |
328 | 'CURLOPT_SSL_SESSIONID_CACHE' => '--no-sessionid', |
329 | 'CURLOPT_SSL_VERIFYHOST' => ['-k', '--insecure'], |
330 | 'CURLOPT_SSL_VERIFYPEER' => ['-k', '--insecure'], |
331 | 'CURLOPT_SSL_VERIFYSTATUS' => '--cert-status', |
332 | 'CURLOPT_STDERR' => '--stderr', // --stderr <file> |
333 | 'CURLOPT_SUPPRESS_CONNECT_HEADERS' => '--suppress-connect-headers', |
334 | 'CURLOPT_TCP_FASTOPEN' => '--tcp-fastopen', |
335 | 'CURLOPT_TCP_KEEPALIVE' => '--keepalive-time', // --keepalive-time <seconds> |
336 | 'CURLOPT_TCP_NODELAY' => '--tcp-nodelay', |
337 | 'CURLOPT_TELNETOPTIONS' => ['-t', '--telnet-option'], // -t, --telnet-option <opt=val> |
338 | 'CURLOPT_TFTP_BLKSIZE' => '--tftp-blksize', // --tftp-blksize <value> |
339 | 'CURLOPT_TFTP_NO_OPTIONS' => '--tftp-no-options', |
340 | 'CURLOPT_TIMECONDITION' => '-z --time-cond', // -z, --time-cond <time> |
341 | 'CURLOPT_TIMEOUT' => '--connect-timeout', // --connect-timeout <fractional seconds> |
342 | 'CURLOPT_TIMEOUT_MS' => '--connect-timeout', // --connect-timeout <fractional seconds> (MS needs to be converted to seconds), |
343 | 'CURLOPT_TLS13_CIPHERS' => '--tls13-ciphers', // --tls13-ciphers <ciphersuite list> |
344 | 'CURLOPT_TLSAUTH_PASSWORD' => '--tlspassword', // --tlspassword <string> |
345 | 'CURLOPT_TLSAUTH_TYPE' => '--tlsauthtype', // --tlsauthtype <type> |
346 | 'CURLOPT_TLSAUTH_USERNAME' => '--tlsuser', // --tlsuser <name> |
347 | 'CURLOPT_TRANSFER_ENCODING' => ['--tr-encoding', '--no-tr-encoding'], |
348 | 'CURLOPT_UNIX_SOCKET_PATH' => '--unix-socket', // --unix-socket <path> |
349 | 'CURLOPT_URL' => '--url', // --url <url> (Used for config files, unnecessary on the CLI) |
350 | 'CURLOPT_USERAGENT' => ['-A', '--user-agent'], // -A, --user-agent <name> |
351 | 'CURLOPT_USERNAME' => ['-u', '--user'], // -u, --user <user:password> |
352 | 'CURLOPT_USERPWD' => ['-u', '--user'], // -u, --user <user:password> |
353 | 'CURLOPT_USE_SSL' => ['--ssl', '--ssl-reqd'], // Attempts to force server to use secure connection', |
354 | 'CURLOPT_VERBOSE' => ['-v', '--verbose'], |
355 | 'CURLOPT_XOAUTH2_BEARER' => '--oauth2-bearer', // --oauth2-bearer <token> |
356 | 'CURLSSLOPT_ALLOW_BEAST' => '--ssl-allow-beast', |
357 | 'CURLSSLOPT_AUTO_CLIENT_CERT' => '--ssl-auto-client-cert', |
358 | 'CURLSSLOPT_NO_REVOKE' => '--ssl-no-revoke', |
359 | 'CURLSSLOPT_REVOKE_BEST_EFFORT' => '--ssl-revoke-best-effort', |
360 | ]; |
361 | |
362 | /** |
363 | * Curl options that require a value |
364 | * @var array |
365 | */ |
366 | protected static array $valueOptions = [ |
367 | '--abstract-unix-socket' => null, // --abstract-unix-socket <path> |
368 | '--alt-svc' => null, // --alt-svc <filename> |
369 | '--aws-sigv4' => null, // --aws-sigv4 <provider1[:provider2[:region[:service]]]>[ |
370 | '--cacert' => null, // --cacert <file> |
371 | '--capath' => null, // --capath <dir> |
372 | '--connect-timeout' => null, // --connect-timeout <fractional seconds> (MS needs to be converted to seconds) |
373 | '--connect-to' => null, // --connect-to <HOST1:PORT1:HOST2:PORT2> |
374 | '-b' => null, // -b, --cookie <data|filename> |
375 | '--cookie' => null, // -b, --cookie <data|filename> |
376 | '-c' => null, // -c, --cookie-jar <filename> |
377 | '--cookie-jar' => null, // -c, --cookie-jar <filename> |
378 | '--crlfile' => null, // --crlfile <file> |
379 | '-X' => null, // -X, --request <method> |
380 | '--request' => null, // -X, --request <method> |
381 | '--dns-interface' => null, // --dns-interface <interface> |
382 | '--dns-ipv4-addr' => null, // --dns-ipv4-addr <address> |
383 | '--dns-ipv6-addr' => null, // --dns-ipv6-addr <address> |
384 | '--dns-servers' => null, // --dns-servers <addresses> |
385 | '--doh-insecure' => null, // Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name and certificate. Available as of PHP 8.2.0 and cURL 7.76.0. |
386 | '--no-doh-insecure' => null, // Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name and certificate. Available as of PHP 8.2.0 and cURL 7.76.0. |
387 | '--doh-cert-status' => null, // Tell cURL to verify the status of the DNS-over-HTTPS server certificate using the "Certificate Status Request" TLS extension (OCSP stapling). Available as of PHP 8.2.0 and cURL 7.76.0. |
388 | '--doh-url' => null, // --doh-url <url> Provides the DNS-over-HTTPS URL. Available as of PHP 8.1.0 and cURL 7.62.0. |
389 | '--expect100-timeout' => null, // --expect100-timeout <seconds> |
390 | '-P' => null, // -P, --ftp-port <address> |
391 | '--ftp-port' => null, // -P, --ftp-port <address> |
392 | '--ftp-account' => null, // --ftp-account <data> |
393 | '--ftp-alternative-to-user' => null, // --ftp-alternative-to-user <command> |
394 | '--ftp-method' => null, // --ftp-method <method> |
395 | '--delegation' => null, // --delegation <level> |
396 | '--happy-eyeballs-timeout-ms' => null, // --happy-eyeballs-timeout-ms <milliseconds> |
397 | '--hsts' => null, // --hsts <filename> |
398 | '-H' => null, // -H, --header <header/@file> |
399 | '--header' => null, // -H, --header <header/@file> |
400 | '-0' => CURL_HTTP_VERSION_1_0, // CURL HTTP Version constant |
401 | '--http1.0' => CURL_HTTP_VERSION_1_0, // CURL HTTP Version constant |
402 | '--http1.1' => CURL_HTTP_VERSION_1_1, // CURL HTTP Version constant |
403 | '--http2' => CURL_HTTP_VERSION_2_0, // CURL HTTP Version constant |
404 | '-T' => null, // -T, --upload-file <file> (Used with PUT) |
405 | '--upload-file' => null, // -T, --upload-file <file> (Used with PUT) |
406 | '--interface' => null, // --interface <name> |
407 | '--krb' => null, // --krb <level> |
408 | '--local-port' => null, // --local-port <num/range> |
409 | '--login-options' => null, // --login-options <options> |
410 | '-Y' => null, // -Y, --speed-limit <speed> |
411 | '--speed-limit' => null, // -Y, --speed-limit <speed> |
412 | '-y' => null, // -y, --speed-time <seconds> |
413 | '--speed-time' => null, // -y, --speed-time <seconds> |
414 | '--mail-auth' => null, // --mail-auth <address> |
415 | '--mail-from' => null, // --mail-from <address> |
416 | '--mail-rcpt' => null, // --mail-rcpt <address> |
417 | '--max-filesize' => null, // --max-filesize <bytes> |
418 | '-m' => null, // -m, --max-time <fractional seconds> |
419 | '--max-time' => null, // -m, --max-time <fractional seconds> |
420 | '--max-redirs' => null, // --max-redirs <num> |
421 | '--netrc-file' => null, // --netrc-file <filename> |
422 | '--noproxy' => null, // --noproxy <no-proxy-list> |
423 | '-u' => null, // -u, --user <user:password> |
424 | '--user' => null, // -u, --user <user:password> |
425 | '-d' => null, // -d, --data <data> |
426 | '-data' => null, // -d, --data <data> |
427 | '-x' => null, // -x, --proxy [protocol://]host[:port] |
428 | '--proxy' => null, // -x, --proxy [protocol://]host[:port] |
429 | '--proxy-basic' => CURLAUTH_BASIC, // CURL Auth constant |
430 | '--proxy-digest' => CURLAUTH_DIGEST, // CURL Auth constant |
431 | '--proxy-header' => null, // --proxy-header <header/@file> |
432 | '-U' => null, // -U, --proxy-user <user:password> |
433 | '--proxy-user' => null, // -U, --proxy-user <user:password> |
434 | '--proxy-cacert' => null, // --proxy-cacert <file> |
435 | '--proxy-capath' => null, // --proxy-capath <dir> |
436 | '--proxy-crlfile' => null, // --proxy-crlfile <file> |
437 | '--proxy-pass' => null, // --proxy-pass <phrase> |
438 | '--proxy-pinnedpubkey' => null, // --proxy-pinnedpubkey <hashes> |
439 | '--proxy-service-name' => null, // --proxy-service-name <name> |
440 | '--proxy-cert' => null, // --proxy-cert <cert[:passwd]> |
441 | '--proxy-cert-type' => null, // --proxy-cert-type <type> |
442 | '--proxy-key' => null, // --proxy-key <key> |
443 | '--proxy-key-type' => null, // --proxy-key-type <type> |
444 | '--proxy-ciphers' => null, // --proxy-ciphers <list> |
445 | '--proxy-tls13-ciphers' => null, // --proxy-tls13-ciphers <ciphersuite list> |
446 | '--proxy-tlspassword' => null, // --proxy-tlspassword <string> |
447 | '--proxy-tlsauthtype' => null, // --proxy-tlsauthtype <type> |
448 | '--proxy-tlsuser' => null, // --proxy-tlsuser <name> |
449 | '-Q' => null, // -Q, --quote <command> |
450 | '--quote' => null, // -Q, --quote <command> |
451 | '--random-file' => null, // --random-file <file> |
452 | '-r' => null, // -r, --range <range> |
453 | '--range' => null, // -r, --range <range> |
454 | '-e' => null, // -e, --referer <url> |
455 | '--referer' => null, // -e, --referer <url> |
456 | '--resolve' => null, // --resolve <[+]host:port:addr[,addr]...> |
457 | '--sasl-authzid' => null, // --sasl-authzid <identity> |
458 | '--service-name' => null, // --service-name <name> |
459 | '--socks5-gssapi-service' => null, // --socks5-gssapi-service <name> |
460 | '--hostpubmd5' => null, // --hostpubmd5 <md5> |
461 | '--hostpubsha256' => null, // --hostpubsha256 <sha256> |
462 | '--pubkey' => null, // --pubkey <key> |
463 | '-E' => null, // -E, --cert <certificate[:password]> |
464 | '--cert' => null, // -E, --cert <certificate[:password]> |
465 | '--cert-type' => null, // --cert-type <type> |
466 | '--engine' => null, // --engine <name> |
467 | '--key' => null, // --key <key> |
468 | '--pass' => null, // --pass <phrase> |
469 | '--key-type' => null, // --key-type <type> |
470 | '-2' => CURL_SSLVERSION_SSLv2, // CURL SSL Version contstant |
471 | '--sslv2' => CURL_SSLVERSION_SSLv2, // CURL SSL Version contstant |
472 | '-3' => CURL_SSLVERSION_SSLv3, // CURL SSL Version contstant |
473 | '--sslv3' => CURL_SSLVERSION_SSLv3, // CURL SSL Version contstant |
474 | '--ciphers' => null, // --ciphers <list of ciphers> i.e. ECDHE-ECDSA-AES256-CCM8 |
475 | '--curves' => null, // --curves <algorithm list> |
476 | '--stderr' => null, // --stderr <file> |
477 | '--keepalive-time' => null, // --keepalive-time <seconds> |
478 | '-t' => null, // -t, --telnet-option <opt=val> |
479 | '--telnet-option' => null, // -t, --telnet-option <opt=val> |
480 | '--tftp-blksize' => null, // --tftp-blksize <value> |
481 | '-z --time-cond' => null, // -z, --time-cond <time> |
482 | '--tls13-ciphers' => null, // --tls13-ciphers <ciphersuite list> |
483 | '--tlspassword' => null, // --tlspassword <string> |
484 | '--tlsauthtype' => null, // --tlsauthtype <type> |
485 | '--tlsuser' => null, // --tlsuser <name> |
486 | '--unix-socket' => null, // --unix-socket <path> |
487 | '--url' => null, // --url <url> (Used for config files, unnecessary on the CLI) |
488 | '-A' => null, // -A, --user-agent <name> |
489 | '--user-agent' => null, // -A, --user-agent <name> |
490 | '--oauth2-bearer' => null, // --oauth2-bearer <token> |
491 | 'CURLOPT_ABSTRACT_UNIX_SOCKET' => null, // --abstract-unix-socket <path> |
492 | 'CURLOPT_ALTSVC' => null, // --alt-svc <filename> |
493 | 'CURLOPT_AWS_SIGV4' => null, // --aws-sigv4 <provider1[:provider2[:region[:service]]]> |
494 | 'CURLOPT_CAINFO' => null, // --cacert <file> |
495 | 'CURLOPT_CAPATH' => null, // --capath <dir> |
496 | 'CURLOPT_CONNECTTIMEOUT' => null, // --connect-timeout <fractional seconds> |
497 | 'CURLOPT_CONNECT_TO' => null, // --connect-to <HOST1:PORT1:HOST2:PORT2> |
498 | 'CURLOPT_COOKIE' => null, // -b, --cookie <data|filename> |
499 | 'CURLOPT_COOKIEJAR' => null, // -c, --cookie-jar <filename> |
500 | 'CURLOPT_CRLFILE' => null, // --crlfile <file> |
501 | 'CURLOPT_CUSTOMREQUEST' => null, // -X, --request <method> |
502 | 'CURLOPT_DNS_INTERFACE' => null, // --dns-interface <interface> |
503 | 'CURLOPT_DNS_LOCAL_IP4' => null, // --dns-ipv4-addr <address> |
504 | 'CURLOPT_DNS_LOCAL_IP6' => null, // --dns-ipv6-addr <address> |
505 | 'CURLOPT_DNS_SERVERS' => null, // --dns-servers <addresses> |
506 | 'CURLOPT_DOH_URL' => null, // --doh-url <url> Provides the DNS-over-HTTPS URL. Available as of PHP 8.1.0 and cURL 7.62.0. |
507 | 'CURLOPT_EXPECT_100_TIMEOUT_MS' => null, // --expect100-timeout <seconds> |
508 | 'CURLOPT_FTPPORT' => null, // -P, --ftp-port <address> |
509 | 'CURLOPT_FTP_ACCOUNT' => null, // --ftp-account <data> |
510 | 'CURLOPT_FTP_ALTERNATIVE_TO_USER' => null, // --ftp-alternative-to-user <command> |
511 | 'CURLOPT_FTP_FILEMETHOD' => null, // --ftp-method <method> |
512 | 'CURLOPT_GSSAPI_DELEGATION' => null, // --delegation <level> |
513 | 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS' => null, // --happy-eyeballs-timeout-ms <milliseconds> |
514 | 'CURLOPT_HSTS' => null, // --hsts <filename> |
515 | 'CURLOPT_HTTPHEADER' => null, // -H, --header <header/@file> |
516 | 'CURLOPT_HTTP_VERSION' => [CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, CURL_HTTP_VERSION_2_0], // CURL HTTP version constant |
517 | 'CURLOPT_INFILE' => null, // -T, --upload-file <file> (Used with PUT) |
518 | 'CURLOPT_INTERFACE' => null, // --interface <name> |
519 | 'CURLOPT_KRBLEVEL' => null, // --krb <level> |
520 | 'CURLOPT_LOCALPORT' => null, // --local-port <num/range> |
521 | 'CURLOPT_LOCALPORTRANGE' => null, // --local-port <num/range> |
522 | 'CURLOPT_LOGIN_OPTIONS' => null, // --login-options <options> |
523 | 'CURLOPT_LOW_SPEED_LIMIT' => null, // -Y, --speed-limit <speed> |
524 | 'CURLOPT_LOW_SPEED_TIME' => null, // -y, --speed-time <seconds> |
525 | 'CURLOPT_MAIL_AUTH' => null, // --mail-auth <address> |
526 | 'CURLOPT_MAIL_FROM' => null, // --mail-from <address> |
527 | 'CURLOPT_MAIL_RCPT' => null, // --mail-rcpt <address> |
528 | 'CURLOPT_MAXFILESIZE' => null, // --max-filesize <bytes> |
529 | 'CURLOPT_MAXLIFETIME_CONN' => null, // -m, --max-time <fractional seconds> |
530 | 'CURLOPT_MAXREDIRS' => null, // --max-redirs <num> |
531 | 'CURLOPT_NETRC_FILE' => null, // --netrc-file <filename> |
532 | 'CURLOPT_NOPROXY' => null, // --noproxy <no-proxy-list> |
533 | 'CURLOPT_PASSWORD' => null, // -u, --user <user:password> |
534 | 'CURLOPT_POST' => null, // -X, --request <method> |
535 | 'CURLOPT_POSTFIELDS' => null, // -d, --data <data> |
536 | 'CURLOPT_PROXY' => null, // -x, --proxy [protocol://]host[:port] |
537 | 'CURLOPT_PROXYAUTH' => [CURLAUTH_BASIC, CURLAUTH_DIGEST], // CURL Auth Constant |
538 | 'CURLOPT_PROXYHEADER' => null, // --proxy-header <header/@file> |
539 | 'CURLOPT_PROXYUSERPWD' => null, // -U, --proxy-user <user:password> |
540 | 'CURLOPT_PROXY_CAINFO' => null, // --proxy-cacert <file> |
541 | 'CURLOPT_PROXY_CAPATH' => null, // --proxy-capath <dir> |
542 | 'CURLOPT_PROXY_CRLFILE' => null, // --proxy-crlfile <file> |
543 | 'CURLOPT_PROXY_KEYPASSWD' => null, // --proxy-pass <phrase> |
544 | 'CURLOPT_PROXY_PINNEDPUBLICKEY' => null, // --proxy-pinnedpubkey <hashes> |
545 | 'CURLOPT_PROXY_SERVICE_NAME' => null, // --proxy-service-name <name> |
546 | 'CURLOPT_PROXY_SSLCERT' => null, // --proxy-cert <cert[:passwd]> |
547 | 'CURLOPT_PROXY_SSLCERTTYPE' => null, // --proxy-cert-type <type> |
548 | 'CURLOPT_PROXY_SSLKEY' => null, // --proxy-key <key> |
549 | 'CURLOPT_PROXY_SSLKEYTYPE' => null, // --proxy-key-type <type> |
550 | 'CURLOPT_PROXY_SSL_CIPHER_LIST' => null, // --proxy-ciphers <list> |
551 | 'CURLOPT_PROXY_TLS13_CIPHERS' => null, // --proxy-tls13-ciphers <ciphersuite list> |
552 | 'CURLOPT_PROXY_TLSAUTH_PASSWORD' => null, // --proxy-tlspassword <string> |
553 | 'CURLOPT_PROXY_TLSAUTH_TYPE' => null, // --proxy-tlsauthtype <type> |
554 | 'CURLOPT_PROXY_TLSAUTH_USERNAME' => null, // --proxy-tlsuser <name> |
555 | 'CURLOPT_PUT' => null, // -X, --request <method> |
556 | 'CURLOPT_QUOTE' => null, // -Q, --quote <command> |
557 | 'CURLOPT_RANDOM_FILE' => null, // --random-file <file> |
558 | 'CURLOPT_RANGE' => null, // -r, --range <range> |
559 | 'CURLOPT_REFERER' => null, // -e, --referer <url> |
560 | 'CURLOPT_RESOLVE' => null, // --resolve <[+]host:port:addr[,addr]...> |
561 | 'CURLOPT_SASL_AUTHZID' => null, // --sasl-authzid <identity> |
562 | 'CURLOPT_SERVICE_NAME' => null, // --service-name <name> |
563 | 'CURLOPT_SOCKS5_GSSAPI_SERVICE' => null, // --socks5-gssapi-service <name> |
564 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5' => null, // --hostpubmd5 <md5> |
565 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256' => null, // --hostpubsha256 <sha256> |
566 | 'CURLOPT_SSH_PUBLIC_KEYFILE' => null, // --pubkey <key> |
567 | 'CURLOPT_SSLCERT' => null, // -E, --cert <certificate[:password]> |
568 | 'CURLOPT_SSLCERTTYPE' => null, // --cert-type <type> |
569 | 'CURLOPT_SSLENGINE' => null, // --engine <name> |
570 | 'CURLOPT_SSLKEY' => null, // --key <key> |
571 | 'CURLOPT_SSLKEYPASSWD' => null, // --pass <phrase> |
572 | 'CURLOPT_SSLKEYTYPE' => null, // --key-type <type> |
573 | 'CURLOPT_SSLVERSION' => [CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, CURL_SSLVERSION_SSLv3], // CURL SSL Version constant |
574 | 'CURLOPT_SSL_CIPHER_LIST' => null, // --ciphers <list of ciphers> i.e. ECDHE-ECDSA-AES256-CCM8 |
575 | 'CURLOPT_SSL_EC_CURVES' => null, // --curves <algorithm list> |
576 | 'CURLOPT_STDERR' => null, // --stderr <file> |
577 | 'CURLOPT_TCP_KEEPALIVE' => null, // --keepalive-time <seconds> |
578 | 'CURLOPT_TELNETOPTIONS' => null, // -t, --telnet-option <opt=val> |
579 | 'CURLOPT_TFTP_BLKSIZE' => null, // --tftp-blksize <value> |
580 | 'CURLOPT_TIMECONDITION' => null, // -z, --time-cond <time> |
581 | 'CURLOPT_TIMEOUT' => null, // --connect-timeout <fractional seconds> |
582 | 'CURLOPT_TIMEOUT_MS' => null, // --connect-timeout <fractional seconds> (MS needs to be converted to seconds), |
583 | 'CURLOPT_TLS13_CIPHERS' => null, // --tls13-ciphers <ciphersuite list> |
584 | 'CURLOPT_TLSAUTH_PASSWORD' => null, // --tlspassword <string> |
585 | 'CURLOPT_TLSAUTH_TYPE' => null, // --tlsauthtype <type> |
586 | 'CURLOPT_TLSAUTH_USERNAME' => null, // --tlsuser <name> |
587 | 'CURLOPT_UNIX_SOCKET_PATH' => null, // --unix-socket <path> |
588 | 'CURLOPT_URL' => null, // --url <url> (Used for config files, unnecessary on the CLI) |
589 | 'CURLOPT_USERAGENT' => null, // -A, --user-agent <name> |
590 | 'CURLOPT_USERNAME' => null, // -u, --user <user:password> |
591 | 'CURLOPT_USERPWD' => null, // -u, --user <user:password> |
592 | 'CURLOPT_XOAUTH2_BEARER' => null, // --oauth2-bearer <token> |
593 | ]; |
594 | |
595 | /** |
596 | * Curl option PHP values |
597 | * @var array |
598 | */ |
599 | protected static array $optionValues = [ |
600 | 'CURLOPT_ABSTRACT_UNIX_SOCKET' => 10264, |
601 | 'CURLOPT_ALTSVC' => 10287, |
602 | 'CURLOPT_APPEND' => 50, |
603 | 'CURLOPT_AWS_SIGV4' => 10305, |
604 | 'CURLOPT_CAINFO' => 10065, |
605 | 'CURLOPT_CAPATH' => 10097, |
606 | 'CURLOPT_CONNECTTIMEOUT' => 78, |
607 | 'CURLOPT_CONNECT_TO' => 10243, |
608 | 'CURLOPT_COOKIE' => 10022, |
609 | 'CURLOPT_COOKIEJAR' => 10082, |
610 | 'CURLOPT_CRLF' => 27, |
611 | 'CURLOPT_CRLFILE' => 10169, |
612 | 'CURLOPT_CUSTOMREQUEST' => 10036, |
613 | 'CURLOPT_DISALLOW_USERNAME_IN_URL' => 278, |
614 | 'CURLOPT_DNS_INTERFACE' => 10221, |
615 | 'CURLOPT_DNS_LOCAL_IP4' => 10222, |
616 | 'CURLOPT_DNS_LOCAL_IP6' => 10223, |
617 | 'CURLOPT_DNS_SERVERS' => 10211, |
618 | 'CURLOPT_DOH_SSL_VERIFYHOST' => 307, |
619 | 'CURLOPT_DOH_SSL_VERIFYPEER' => 306, |
620 | 'CURLOPT_DOH_SSL_VERIFYSTATUS' => 308, |
621 | 'CURLOPT_DOH_URL' => 10279, |
622 | 'CURLOPT_EXPECT_100_TIMEOUT_MS' => 227, |
623 | 'CURLOPT_FTPPORT' => 10017, |
624 | 'CURLOPT_FTP_ACCOUNT' => 10134, |
625 | 'CURLOPT_FTP_ALTERNATIVE_TO_USER' => 10147, |
626 | 'CURLOPT_FTP_CREATE_MISSING_DIRS' => 110, |
627 | 'CURLOPT_FTP_FILEMETHOD' => 138, |
628 | 'CURLOPT_FTP_SKIP_PASV_IP' => 137, |
629 | 'CURLOPT_FTP_SSL_CCC' => 154, |
630 | 'CURLOPT_FTP_USE_EPRT' => 106, |
631 | 'CURLOPT_FTP_USE_EPSV' => 85, |
632 | 'CURLOPT_FTP_USE_PRET' => 188, |
633 | 'CURLOPT_GSSAPI_DELEGATION' => 210, |
634 | 'CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS' => 271, |
635 | 'CURLOPT_HAPROXYPROTOCOL' => 274, |
636 | 'CURLOPT_HEADER' => 42, |
637 | 'CURLOPT_HSTS' => 10300, |
638 | 'CURLOPT_HTTP09_ALLOWED' => 285, |
639 | 'CURLOPT_HTTPHEADER' => 10023, |
640 | 'CURLOPT_HTTPPROXYTUNNEL' => 61, |
641 | 'CURLOPT_HTTP_VERSION' => 84, |
642 | 'CURLOPT_IGNORE_CONTENT_LENGTH' => 136, |
643 | 'CURLOPT_INFILE' => 10009, |
644 | 'CURLOPT_INTERFACE' => 10062, |
645 | 'CURLOPT_KRBLEVEL' => 10063, |
646 | 'CURLOPT_LOCALPORT' => 139, |
647 | 'CURLOPT_LOCALPORTRANGE' => 140, |
648 | 'CURLOPT_LOGIN_OPTIONS' => 10224, |
649 | 'CURLOPT_LOW_SPEED_LIMIT' => 19, |
650 | 'CURLOPT_LOW_SPEED_TIME' => 20, |
651 | 'CURLOPT_MAIL_AUTH' => 10217, |
652 | 'CURLOPT_MAIL_FROM' => 10186, |
653 | 'CURLOPT_MAIL_RCPT' => 10187, |
654 | 'CURLOPT_MAIL_RCPT_ALLLOWFAILS' => 290, |
655 | 'CURLOPT_MAXFILESIZE' => 114, |
656 | 'CURLOPT_MAXLIFETIME_CONN' => 314, |
657 | 'CURLOPT_MAXREDIRS' => 68, |
658 | 'CURLOPT_NETRC' => 51, |
659 | 'CURLOPT_NETRC_FILE' => 10118, |
660 | 'CURLOPT_NOPROGRESS' => 43, |
661 | 'CURLOPT_NOPROXY' => 10177, |
662 | 'CURLOPT_PASSWORD' => 10174, |
663 | 'CURLOPT_POST' => 47, |
664 | 'CURLOPT_POSTFIELDS' => 10015, |
665 | 'CURLOPT_PROXY' => 10004, |
666 | 'CURLOPT_PROXYAUTH' => 111, |
667 | 'CURLOPT_PROXYHEADER' => 10228, |
668 | 'CURLOPT_PROXYUSERPWD' => 10006, |
669 | 'CURLOPT_PROXY_CAINFO' => 10246, |
670 | 'CURLOPT_PROXY_CAPATH' => 10247, |
671 | 'CURLOPT_PROXY_CRLFILE' => 10260, |
672 | 'CURLOPT_PROXY_KEYPASSWD' => 10258, |
673 | 'CURLOPT_PROXY_PINNEDPUBLICKEY' => 10263, |
674 | 'CURLOPT_PROXY_SERVICE_NAME' => 10235, |
675 | 'CURLOPT_PROXY_SSLCERT' => 10254, |
676 | 'CURLOPT_PROXY_SSLCERTTYPE' => 10255, |
677 | 'CURLOPT_PROXY_SSLKEY' => 10256, |
678 | 'CURLOPT_PROXY_SSLKEYTYPE' => 10257, |
679 | 'CURLOPT_PROXY_SSL_CIPHER_LIST' => 10259, |
680 | 'CURLOPT_PROXY_SSL_VERIFYHOST' => 249, |
681 | 'CURLOPT_PROXY_SSL_VERIFYPEER' => 248, |
682 | 'CURLOPT_PROXY_TLS13_CIPHERS' => 10277, |
683 | 'CURLOPT_PROXY_TLSAUTH_PASSWORD' => 10252, |
684 | 'CURLOPT_PROXY_TLSAUTH_TYPE' => 10253, |
685 | 'CURLOPT_PROXY_TLSAUTH_USERNAME' => 10251, |
686 | 'CURLOPT_PUT' => 54, |
687 | 'CURLOPT_QUOTE' => 10028, |
688 | 'CURLOPT_RANDOM_FILE' => 10076, |
689 | 'CURLOPT_RANGE' => 10007, |
690 | 'CURLOPT_REFERER' => 10016, |
691 | 'CURLOPT_RESOLVE' => 10203, |
692 | 'CURLOPT_SASL_AUTHZID' => 10289, |
693 | 'CURLOPT_SASL_IR' => 218, |
694 | 'CURLOPT_SERVICE_NAME' => 10236, |
695 | 'CURLOPT_SOCKS5_AUTH' => 267, |
696 | 'CURLOPT_SOCKS5_GSSAPI_NEC' => 180, |
697 | 'CURLOPT_SOCKS5_GSSAPI_SERVICE' => 10179, |
698 | 'CURLOPT_SSH_COMPRESSION' => 268, |
699 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_MD5' => 10162, |
700 | 'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256' => 10311, |
701 | 'CURLOPT_SSH_PUBLIC_KEYFILE' => 10152, |
702 | 'CURLOPT_SSLCERT' => 10025, |
703 | 'CURLOPT_SSLCERTTYPE' => 10086, |
704 | 'CURLOPT_SSLENGINE' => 10089, |
705 | 'CURLOPT_SSLKEY' => 10087, |
706 | 'CURLOPT_SSLKEYPASSWD' => 10026, |
707 | 'CURLOPT_SSLKEYTYPE' => 10088, |
708 | 'CURLOPT_SSLVERSION' => 32, |
709 | 'CURLOPT_SSL_CIPHER_LIST' => 10083, |
710 | 'CURLOPT_SSL_EC_CURVES' => 10298, |
711 | 'CURLOPT_SSL_ENABLE_ALPN' => 226, |
712 | 'CURLOPT_SSL_ENABLE_NPN' => 225, |
713 | 'CURLOPT_SSL_FALSESTART' => 233, |
714 | 'CURLOPT_SSL_SESSIONID_CACHE' => 150, |
715 | 'CURLOPT_SSL_VERIFYHOST' => 81, |
716 | 'CURLOPT_SSL_VERIFYPEER' => 64, |
717 | 'CURLOPT_SSL_VERIFYSTATUS' => 232, |
718 | 'CURLOPT_STDERR' => 10037, |
719 | 'CURLOPT_SUPPRESS_CONNECT_HEADERS' => 265, |
720 | 'CURLOPT_TCP_FASTOPEN' => 244, |
721 | 'CURLOPT_TCP_KEEPALIVE' => 213, |
722 | 'CURLOPT_TCP_NODELAY' => 121, |
723 | 'CURLOPT_TELNETOPTIONS' => 10070, |
724 | 'CURLOPT_TFTP_BLKSIZE' => 178, |
725 | 'CURLOPT_TFTP_NO_OPTIONS' => 242, |
726 | 'CURLOPT_TIMECONDITION' => 33, |
727 | 'CURLOPT_TIMEOUT' => 13, |
728 | 'CURLOPT_TIMEOUT_MS' => 155, |
729 | 'CURLOPT_TLS13_CIPHERS' => 10276, |
730 | 'CURLOPT_TLSAUTH_PASSWORD' => 10205, |
731 | 'CURLOPT_TLSAUTH_TYPE' => 10206, |
732 | 'CURLOPT_TLSAUTH_USERNAME' => 10204, |
733 | 'CURLOPT_TRANSFER_ENCODING' => 207, |
734 | 'CURLOPT_UNIX_SOCKET_PATH' => 10231, |
735 | 'CURLOPT_URL' => 10002, |
736 | 'CURLOPT_USERAGENT' => 10018, |
737 | 'CURLOPT_USERNAME' => 10173, |
738 | 'CURLOPT_USERPWD' => 10005, |
739 | 'CURLOPT_USE_SSL' => 119, |
740 | 'CURLOPT_VERBOSE' => 41, |
741 | 'CURLOPT_XOAUTH2_BEARER' => 10220, |
742 | 'CURLSSLOPT_ALLOW_BEAST' => 1, |
743 | 'CURLSSLOPT_AUTO_CLIENT_CERT' => 32, |
744 | 'CURLSSLOPT_NO_REVOKE' => 2, |
745 | 'CURLSSLOPT_REVOKE_BEST_EFFORT' => 8, |
746 | 'CURLOPT_ACCEPTTIMEOUT_MS' => 212, |
747 | 'CURLOPT_ACCEPT_ENCODING' => 10102, |
748 | 'CURLOPT_ADDRESS_SCOPE' => 171, |
749 | 'CURLOPT_ALTSVC_CTRL' => 286, |
750 | 'CURLOPT_AUTOREFERER' => 58, |
751 | 'CURLOPT_BINARYTRANSFER' => 19914, |
752 | 'CURLOPT_BUFFERSIZE' => 98, |
753 | 'CURLOPT_CAINFO_BLOB' => 40309, |
754 | 'CURLOPT_CERTINFO' => 172, |
755 | 'CURLOPT_CONNECTTIMEOUT_MS' => 156, |
756 | 'CURLOPT_CONNECT_ONLY' => 141, |
757 | 'CURLOPT_COOKIEFILE' => 10031, |
758 | 'CURLOPT_COOKIELIST' => 10135, |
759 | 'CURLOPT_COOKIESESSION' => 96, |
760 | 'CURLOPT_DEFAULT_PROTOCOL' => 10238, |
761 | 'CURLOPT_DIRLISTONLY' => 48, |
762 | 'CURLOPT_DNS_CACHE_TIMEOUT' => 92, |
763 | 'CURLOPT_DNS_SHUFFLE_ADDRESSES' => 275, |
764 | 'CURLOPT_DNS_USE_GLOBAL_CACHE' => 91, |
765 | 'CURLOPT_EGDSOCKET' => 10077, |
766 | 'CURLOPT_ENCODING' => 10102, |
767 | 'CURLOPT_FAILONERROR' => 45, |
768 | 'CURLOPT_FILE' => 10001, |
769 | 'CURLOPT_FILETIME' => 69, |
770 | 'CURLOPT_FNMATCH_FUNCTION' => 20200, |
771 | 'CURLOPT_FOLLOWLOCATION' => 52, |
772 | 'CURLOPT_FORBID_REUSE' => 75, |
773 | 'CURLOPT_FRESH_CONNECT' => 74, |
774 | 'CURLOPT_FTPAPPEND' => 50, |
775 | 'CURLOPT_FTPLISTONLY' => 48, |
776 | 'CURLOPT_FTPSSLAUTH' => 129, |
777 | 'CURLOPT_FTP_RESPONSE_TIMEOUT' => 112, |
778 | 'CURLOPT_FTP_SSL' => 119, |
779 | 'CURLOPT_HEADERFUNCTION' => 20079, |
780 | 'CURLOPT_HEADEROPT' => 229, |
781 | 'CURLOPT_HSTS_CTRL' => 299, |
782 | 'CURLOPT_HTTP200ALIASES' => 10104, |
783 | 'CURLOPT_HTTPAUTH' => 107, |
784 | 'CURLOPT_HTTPGET' => 80, |
785 | 'CURLOPT_HTTP_CONTENT_DECODING' => 158, |
786 | 'CURLOPT_HTTP_TRANSFER_DECODING' => 157, |
787 | 'CURLOPT_INFILESIZE' => 14, |
788 | 'CURLOPT_IPRESOLVE' => 113, |
789 | 'CURLOPT_ISSUERCERT' => 10170, |
790 | 'CURLOPT_ISSUERCERT_BLOB' => 40295, |
791 | 'CURLOPT_KEEP_SENDING_ON_ERROR' => 245, |
792 | 'CURLOPT_KEYPASSWD' => 10026, |
793 | 'CURLOPT_KRB4LEVEL' => 10063, |
794 | 'CURLOPT_MAXAGE_CONN' => 288, |
795 | 'CURLOPT_MAXCONNECTS' => 71, |
796 | 'CURLOPT_MAXFILESIZE_LARGE' => 30117, |
797 | 'CURLOPT_MAX_RECV_SPEED_LARGE' => 30146, |
798 | 'CURLOPT_MAX_SEND_SPEED_LARGE' => 30145, |
799 | 'CURLOPT_NEW_DIRECTORY_PERMS' => 160, |
800 | 'CURLOPT_NEW_FILE_PERMS' => 159, |
801 | 'CURLOPT_NOBODY' => 44, |
802 | 'CURLOPT_NOSIGNAL' => 99, |
803 | 'CURLOPT_PATH_AS_IS' => 234, |
804 | 'CURLOPT_PINNEDPUBLICKEY' => 10230, |
805 | 'CURLOPT_PIPEWAIT' => 237, |
806 | 'CURLOPT_PORT' => 3, |
807 | 'CURLOPT_POSTQUOTE' => 10039, |
808 | 'CURLOPT_POSTREDIR' => 161, |
809 | 'CURLOPT_PREQUOTE' => 10093, |
810 | 'CURLOPT_PRE_PROXY' => 10262, |
811 | 'CURLOPT_PRIVATE' => 10103, |
812 | 'CURLOPT_PROGRESSFUNCTION' => 20056, |
813 | 'CURLOPT_PROTOCOLS' => 181, |
814 | 'CURLOPT_PROXYPASSWORD' => 10176, |
815 | 'CURLOPT_PROXYPORT' => 59, |
816 | 'CURLOPT_PROXYTYPE' => 101, |
817 | 'CURLOPT_PROXYUSERNAME' => 10175, |
818 | 'CURLOPT_PROXY_SSLVERSION' => 250, |
819 | 'CURLOPT_PROXY_CAINFO_BLOB' => 40310, |
820 | 'CURLOPT_PROXY_ISSUERCERT' => 10296, |
821 | 'CURLOPT_PROXY_ISSUERCERT_BLOB' => 40297, |
822 | 'CURLOPT_PROXY_SSLCERT_BLOB' => 40293, |
823 | 'CURLOPT_PROXY_SSLKEY_BLOB' => 40294, |
824 | 'CURLOPT_PROXY_SSL_OPTIONS' => 261, |
825 | 'CURLOPT_PROXY_TRANSFER_MODE' => 166, |
826 | 'CURLOPT_READDATA' => 10009, |
827 | 'CURLOPT_READFUNCTION' => 20012, |
828 | 'CURLOPT_REDIR_PROTOCOLS' => 182, |
829 | 'CURLOPT_REQUEST_TARGET' => 10266, |
830 | 'CURLOPT_RESUME_FROM' => 21, |
831 | 'CURLOPT_RETURNTRANSFER' => 19913, |
832 | 'CURLOPT_RTSP_CLIENT_CSEQ' => 193, |
833 | 'CURLOPT_RTSP_REQUEST' => 189, |
834 | 'CURLOPT_RTSP_SERVER_CSEQ' => 194, |
835 | 'CURLOPT_RTSP_SESSION_ID' => 10190, |
836 | 'CURLOPT_RTSP_STREAM_URI' => 10191, |
837 | 'CURLOPT_RTSP_TRANSPORT' => 10192, |
838 | 'CURLOPT_SAFE_UPLOAD' => -1, |
839 | 'CURLOPT_SHARE' => 10100, |
840 | 'CURLOPT_SSH_AUTH_TYPES' => 151, |
841 | 'CURLOPT_SSH_KNOWNHOSTS' => 10183, |
842 | 'CURLOPT_SSH_PRIVATE_KEYFILE' => 10153, |
843 | 'CURLOPT_SSLCERTPASSWD' => 10026, |
844 | 'CURLOPT_SSLCERT_BLOB' => 40291, |
845 | 'CURLOPT_SSLENGINE_DEFAULT' => 90, |
846 | 'CURLOPT_SSLKEY_BLOB' => 40292, |
847 | 'CURLOPT_SSL_OPTIONS' => 216, |
848 | 'CURLOPT_STREAM_WEIGHT' => 239, |
849 | 'CURLOPT_TCP_KEEPIDLE' => 214, |
850 | 'CURLOPT_TCP_KEEPINTVL' => 215, |
851 | 'CURLOPT_TIMEVALUE' => 34, |
852 | 'CURLOPT_TIMEVALUE_LARGE' => 30270, |
853 | 'CURLOPT_TRANSFERTEXT' => 53, |
854 | 'CURLOPT_UNRESTRICTED_AUTH' => 105, |
855 | 'CURLOPT_UPKEEP_INTERVAL_MS' => 281, |
856 | 'CURLOPT_UPLOAD' => 46, |
857 | 'CURLOPT_UPLOAD_BUFFERSIZE' => 280, |
858 | 'CURLOPT_WILDCARDMATCH' => 197, |
859 | 'CURLOPT_WRITEFUNCTION' => 20011, |
860 | 'CURLOPT_WRITEHEADER' => 10029, |
861 | 'CURLOPT_XFERINFOFUNCTION' => 20219, |
862 | 'CURLSSLOPT_NATIVE_CA' => 16, |
863 | 'CURLSSLOPT_NO_PARTIALCHAIN' => 4, |
864 | ]; |
865 | |
866 | /** |
867 | * Options to omit from conversion, as they are addressed elsewhere in the conversion |
868 | * |
869 | * @var array |
870 | */ |
871 | protected static array $omitOptions = [ |
872 | 'CURLOPT_CUSTOMREQUEST', 'CURLOPT_HEADER', 'CURLOPT_HTTPHEADER', 'CURLOPT_POST', 'CURLOPT_POSTFIELDS', |
873 | 'CURLOPT_PUT', 'CURLOPT_RETURNTRANSFER', 'CURLOPT_URL', 'CURLOPT_SSL_VERIFYHOST', 'CURLOPT_SSL_VERIFYPEER', |
874 | '-i', '-X', '--request', '-H', '--header', '-d', '--data', '-F', '--form', '-k', '--insecure', '--url', |
875 | ]; |
876 | |
877 | /** |
878 | * Unresolved Curl options |
879 | * |
880 | * These are Curl options in PHP that have not yet been mapped to a CLI option |
881 | * |
882 | * @var array |
883 | */ |
884 | protected static array $unresolvedOptions = [ |
885 | 'CURLOPT_ACCEPTTIMEOUT_MS', |
886 | 'CURLOPT_ACCEPT_ENCODING', |
887 | 'CURLOPT_ADDRESS_SCOPE', |
888 | 'CURLOPT_ALTSVC_CTRL', |
889 | 'CURLOPT_AUTOREFERER', |
890 | 'CURLOPT_BINARYTRANSFER', |
891 | 'CURLOPT_BUFFERSIZE', |
892 | 'CURLOPT_CAINFO_BLOB', |
893 | 'CURLOPT_CERTINFO', |
894 | 'CURLOPT_CONNECTTIMEOUT_MS', |
895 | 'CURLOPT_CONNECT_ONLY', |
896 | 'CURLOPT_COOKIEFILE', |
897 | 'CURLOPT_COOKIELIST', |
898 | 'CURLOPT_COOKIESESSION', |
899 | 'CURLOPT_DEFAULT_PROTOCOL', |
900 | 'CURLOPT_DIRLISTONLY', |
901 | 'CURLOPT_DNS_CACHE_TIMEOUT', |
902 | 'CURLOPT_DNS_SHUFFLE_ADDRESSES', |
903 | 'CURLOPT_DNS_USE_GLOBAL_CACHE', |
904 | 'CURLOPT_EGDSOCKET', |
905 | 'CURLOPT_ENCODING', |
906 | 'CURLOPT_FAILONERROR', |
907 | 'CURLOPT_FILE', |
908 | 'CURLOPT_FILETIME', |
909 | 'CURLOPT_FNMATCH_FUNCTION', |
910 | 'CURLOPT_FOLLOWLOCATION', // This constant is not available when open_basedir is enabled. |
911 | 'CURLOPT_FORBID_REUSE', |
912 | 'CURLOPT_FRESH_CONNECT', |
913 | 'CURLOPT_FTPAPPEND', |
914 | 'CURLOPT_FTPLISTONLY', |
915 | 'CURLOPT_FTPSSLAUTH', |
916 | 'CURLOPT_FTP_RESPONSE_TIMEOUT', |
917 | 'CURLOPT_FTP_SSL', |
918 | 'CURLOPT_HEADERFUNCTION', |
919 | 'CURLOPT_HEADEROPT', |
920 | 'CURLOPT_HSTS_CTRL', |
921 | 'CURLOPT_HTTP200ALIASES', |
922 | 'CURLOPT_HTTPAUTH', |
923 | 'CURLOPT_HTTPGET', |
924 | 'CURLOPT_HTTP_CONTENT_DECODING', |
925 | 'CURLOPT_HTTP_TRANSFER_DECODING', |
926 | 'CURLOPT_INFILESIZE', |
927 | 'CURLOPT_IPRESOLVE', |
928 | 'CURLOPT_ISSUERCERT', |
929 | 'CURLOPT_ISSUERCERT_BLOB', // Issuer SSL certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
930 | 'CURLOPT_KEEP_SENDING_ON_ERROR', |
931 | 'CURLOPT_KEYPASSWD', |
932 | 'CURLOPT_KRB4LEVEL', |
933 | 'CURLOPT_MAXAGE_CONN', |
934 | 'CURLOPT_MAXCONNECTS', |
935 | 'CURLOPT_MAXFILESIZE_LARGE', |
936 | 'CURLOPT_MAX_RECV_SPEED_LARGE', |
937 | 'CURLOPT_MAX_SEND_SPEED_LARGE', |
938 | 'CURLOPT_NEW_DIRECTORY_PERMS', |
939 | 'CURLOPT_NEW_FILE_PERMS', |
940 | 'CURLOPT_NOBODY', |
941 | 'CURLOPT_NOSIGNAL', |
942 | 'CURLOPT_PATH_AS_IS', |
943 | 'CURLOPT_PINNEDPUBLICKEY', |
944 | 'CURLOPT_PIPEWAIT', |
945 | 'CURLOPT_PORT', |
946 | 'CURLOPT_POSTQUOTE', |
947 | 'CURLOPT_POSTREDIR', |
948 | 'CURLOPT_PREQUOTE', |
949 | 'CURLOPT_PRE_PROXY', |
950 | 'CURLOPT_PRIVATE', |
951 | 'CURLOPT_PROGRESSFUNCTION', |
952 | 'CURLOPT_PROTOCOLS', |
953 | 'CURLOPT_PROXYPASSWORD', |
954 | 'CURLOPT_PROXYPORT', |
955 | 'CURLOPT_PROXYTYPE', |
956 | 'CURLOPT_PROXYUSERNAME', |
957 | 'CURLOPT_PROXY_SSLVERSION', |
958 | 'CURLOPT_PROXY_CAINFO_BLOB', |
959 | 'CURLOPT_PROXY_ISSUERCERT', // Proxy issuer SSL certificate filename. Available as of PHP 8.1.0 and cURL 7.71.0. |
960 | 'CURLOPT_PROXY_ISSUERCERT_BLOB', // Proxy issuer SSL certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
961 | 'CURLOPT_PROXY_SSLCERT_BLOB', // SSL proxy client certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
962 | 'CURLOPT_PROXY_SSLKEY_BLOB', // Private key for proxy cert from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
963 | 'CURLOPT_PROXY_SSL_OPTIONS', |
964 | 'CURLOPT_PROXY_TRANSFER_MODE', |
965 | 'CURLOPT_READDATA', |
966 | 'CURLOPT_READFUNCTION', |
967 | 'CURLOPT_REDIR_PROTOCOLS', |
968 | 'CURLOPT_REQUEST_TARGET', |
969 | 'CURLOPT_RESUME_FROM', |
970 | 'CURLOPT_RETURNTRANSFER', |
971 | 'CURLOPT_RTSP_CLIENT_CSEQ', |
972 | 'CURLOPT_RTSP_REQUEST', |
973 | 'CURLOPT_RTSP_SERVER_CSEQ', |
974 | 'CURLOPT_RTSP_SESSION_ID', |
975 | 'CURLOPT_RTSP_STREAM_URI', |
976 | 'CURLOPT_RTSP_TRANSPORT', |
977 | 'CURLOPT_SAFE_UPLOAD', |
978 | 'CURLOPT_SHARE', |
979 | 'CURLOPT_SSH_AUTH_TYPES', |
980 | 'CURLOPT_SSH_KNOWNHOSTS', |
981 | 'CURLOPT_SSH_PRIVATE_KEYFILE', |
982 | 'CURLOPT_SSLCERTPASSWD', |
983 | 'CURLOPT_SSLCERT_BLOB', // SSL client certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
984 | 'CURLOPT_SSLENGINE_DEFAULT', |
985 | 'CURLOPT_SSLKEY_BLOB', // Private key for client cert from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. |
986 | 'CURLOPT_SSL_OPTIONS', |
987 | 'CURLOPT_STREAM_WEIGHT', |
988 | 'CURLOPT_TCP_KEEPIDLE', |
989 | 'CURLOPT_TCP_KEEPINTVL', |
990 | 'CURLOPT_TIMEVALUE', |
991 | 'CURLOPT_TIMEVALUE_LARGE', |
992 | 'CURLOPT_TRANSFERTEXT', |
993 | 'CURLOPT_UNRESTRICTED_AUTH', |
994 | 'CURLOPT_UPKEEP_INTERVAL_MS', |
995 | 'CURLOPT_UPLOAD', |
996 | 'CURLOPT_UPLOAD_BUFFERSIZE', |
997 | 'CURLOPT_WILDCARDMATCH', |
998 | 'CURLOPT_WRITEFUNCTION', |
999 | 'CURLOPT_WRITEHEADER', |
1000 | 'CURLOPT_XFERINFOFUNCTION', |
1001 | 'CURLSSLOPT_NATIVE_CA', |
1002 | 'CURLSSLOPT_NO_PARTIALCHAIN', |
1003 | ]; |
1004 | |
1005 | /** |
1006 | * Check if the option is valid |
1007 | * |
1008 | * @param string $option |
1009 | * @return bool |
1010 | */ |
1011 | public static function isValidOption(string $option): bool |
1012 | { |
1013 | return (array_key_exists($option, self::$commandOptions) || array_key_exists($option, self::$phpOptions)); |
1014 | } |
1015 | |
1016 | /** |
1017 | * Check if the option is a valid CLI option |
1018 | * |
1019 | * @param string $option |
1020 | * @return bool |
1021 | */ |
1022 | public static function isCommandOption(string $option): bool |
1023 | { |
1024 | return array_key_exists($option, self::$commandOptions); |
1025 | } |
1026 | |
1027 | /** |
1028 | * Check if the option is a valid PHP option |
1029 | * |
1030 | * @param string $option |
1031 | * @return bool |
1032 | */ |
1033 | public static function isPhpOption(string $option): bool |
1034 | { |
1035 | return array_key_exists($option, self::$phpOptions); |
1036 | } |
1037 | |
1038 | /** |
1039 | * Check if the option requires a value |
1040 | * |
1041 | * @param string $option |
1042 | * @return bool |
1043 | */ |
1044 | public static function isValueOption(string $option): bool |
1045 | { |
1046 | return array_key_exists($option, self::$valueOptions); |
1047 | } |
1048 | |
1049 | /** |
1050 | * Check if the option is a boolean option |
1051 | * |
1052 | * @param string $option |
1053 | * @return bool |
1054 | */ |
1055 | public static function isBooleanOption(string $option): bool |
1056 | { |
1057 | return !array_key_exists($option, self::$valueOptions); |
1058 | } |
1059 | |
1060 | /** |
1061 | * Get the CLI options |
1062 | * |
1063 | * @return array |
1064 | */ |
1065 | public static function getCommandOptions(): array |
1066 | { |
1067 | return self::$commandOptions; |
1068 | } |
1069 | |
1070 | /** |
1071 | * Get CLI option |
1072 | * |
1073 | * @return string|array|null |
1074 | */ |
1075 | public static function getCommandOption(string $option): string|array|null |
1076 | { |
1077 | return self::$commandOptions[$option] ?? null; |
1078 | } |
1079 | |
1080 | /** |
1081 | * Get the PHP options |
1082 | * |
1083 | * @return array |
1084 | */ |
1085 | public static function getPhpOptions(): array |
1086 | { |
1087 | return self::$phpOptions; |
1088 | } |
1089 | |
1090 | /** |
1091 | * Get Php option |
1092 | * |
1093 | * @return string|array|null |
1094 | */ |
1095 | public static function getPhpOption(string $option): string|array|null |
1096 | { |
1097 | return self::$phpOptions[$option] ?? null; |
1098 | } |
1099 | |
1100 | /** |
1101 | * Get the value options |
1102 | * |
1103 | * @return array |
1104 | */ |
1105 | public static function getValueOptions(): array |
1106 | { |
1107 | return self::$valueOptions; |
1108 | } |
1109 | |
1110 | /** |
1111 | * Get value option |
1112 | * |
1113 | * @return mixed |
1114 | */ |
1115 | public static function getValueOption(string $option): mixed |
1116 | { |
1117 | return self::$valueOptions[$option] ?? null; |
1118 | } |
1119 | |
1120 | /** |
1121 | * Get the option value by name |
1122 | * |
1123 | * @return int|null |
1124 | */ |
1125 | public static function getOptionValueByName(string $curlOption): int|null |
1126 | { |
1127 | return self::$optionValues[$curlOption] ?? null; |
1128 | } |
1129 | |
1130 | /** |
1131 | * Get the option name by value |
1132 | * |
1133 | * @return string|null |
1134 | */ |
1135 | public static function getOptionNameByValue(int $curlValue): string|null |
1136 | { |
1137 | return array_search($curlValue, self::$optionValues) ?? null; |
1138 | } |
1139 | |
1140 | /** |
1141 | * Has the option value by name |
1142 | * |
1143 | * @return bool |
1144 | */ |
1145 | public static function hasOptionValueByName(string $curlOption): bool |
1146 | { |
1147 | return isset(self::$optionValues[$curlOption]); |
1148 | } |
1149 | |
1150 | /** |
1151 | * Has the option name by value |
1152 | * |
1153 | * @return bool |
1154 | */ |
1155 | public static function hasOptionNameByValue(int $curlValue): bool |
1156 | { |
1157 | return in_array($curlValue, self::$optionValues); |
1158 | } |
1159 | |
1160 | /** |
1161 | * Get the omit options |
1162 | * |
1163 | * @return array |
1164 | */ |
1165 | public static function getOmitOptions(): array |
1166 | { |
1167 | return self::$omitOptions; |
1168 | } |
1169 | |
1170 | /** |
1171 | * Is omit option |
1172 | * |
1173 | * @return bool |
1174 | */ |
1175 | public static function isOmitOption(string $option): bool |
1176 | { |
1177 | return in_array($option, self::$omitOptions); |
1178 | } |
1179 | |
1180 | } |