PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / lib / packages / Safe / generated / curl.php

curl.php in Defender Security – Malware Scanner, Login Security & Firewall 6.3.0, at lib/packages/Safe/generated/curl.php

3,158 lines 68.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WP_DEFENDER_VENDOR\Safe;
4
5 use WP_DEFENDER_VENDOR\Safe\Exceptions\CurlException;
6
7 /**
8 * This function URL encodes the given string according to RFC 3986.
9 *
10 * @param resource $ch A cURL handle returned by
11 * curl_init.
12 * @param string $str The string to be encoded.
13 * @return string Returns escaped string.
14 * @throws CurlException
15 *
16 */
17 function curl_escape($ch, string $str): string
18 {
19 error_clear_last();
20 $result = \curl_escape($ch, $str);
21 if ($result === false) {
22 throw CurlException::createFromCurlResource($ch);
23 }
24 return $result;
25 }
26
27
28 /**
29 * Execute the given cURL session.
30 *
31 * This function should be called after initializing a cURL session and all
32 * the options for the session are set.
33 *
34 * @param resource $ch A cURL handle returned by
35 * curl_init.
36 * @return bool|string Returns TRUE on success. However, if the CURLOPT_RETURNTRANSFER
37 * option is set, it will return
38 * the result on success, FALSE on failure.
39 * @throws CurlException
40 *
41 */
42 function curl_exec($ch)
43 {
44 error_clear_last();
45 $result = \curl_exec($ch);
46 if ($result === false) {
47 throw CurlException::createFromCurlResource($ch);
48 }
49 return $result;
50 }
51
52
53 /**
54 * Gets information about the last transfer.
55 *
56 * @param resource $ch A cURL handle returned by
57 * curl_init.
58 * @param int|null $opt This may be one of the following constants:
59 *
60 *
61 *
62 * CURLINFO_EFFECTIVE_URL - Last effective URL
63 *
64 *
65 *
66 *
67 * CURLINFO_HTTP_CODE - The last response code.
68 * As of PHP 5.5.0 and cURL 7.10.8, this is a legacy alias of
69 * CURLINFO_RESPONSE_CODE
70 *
71 *
72 *
73 *
74 * CURLINFO_FILETIME - Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown
75 *
76 *
77 *
78 *
79 * CURLINFO_TOTAL_TIME - Total transaction time in seconds for last transfer
80 *
81 *
82 *
83 *
84 * CURLINFO_NAMELOOKUP_TIME - Time in seconds until name resolving was complete
85 *
86 *
87 *
88 *
89 * CURLINFO_CONNECT_TIME - Time in seconds it took to establish the connection
90 *
91 *
92 *
93 *
94 * CURLINFO_PRETRANSFER_TIME - Time in seconds from start until just before file transfer begins
95 *
96 *
97 *
98 *
99 * CURLINFO_STARTTRANSFER_TIME - Time in seconds until the first byte is about to be transferred
100 *
101 *
102 *
103 *
104 * CURLINFO_REDIRECT_COUNT - Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled
105 *
106 *
107 *
108 *
109 * CURLINFO_REDIRECT_TIME - Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled
110 *
111 *
112 *
113 *
114 * CURLINFO_REDIRECT_URL - With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL
115 *
116 *
117 *
118 *
119 * CURLINFO_PRIMARY_IP - IP address of the most recent connection
120 *
121 *
122 *
123 *
124 * CURLINFO_PRIMARY_PORT - Destination port of the most recent connection
125 *
126 *
127 *
128 *
129 * CURLINFO_LOCAL_IP - Local (source) IP address of the most recent connection
130 *
131 *
132 *
133 *
134 * CURLINFO_LOCAL_PORT - Local (source) port of the most recent connection
135 *
136 *
137 *
138 *
139 * CURLINFO_SIZE_UPLOAD - Total number of bytes uploaded
140 *
141 *
142 *
143 *
144 * CURLINFO_SIZE_DOWNLOAD - Total number of bytes downloaded
145 *
146 *
147 *
148 *
149 * CURLINFO_SPEED_DOWNLOAD - Average download speed
150 *
151 *
152 *
153 *
154 * CURLINFO_SPEED_UPLOAD - Average upload speed
155 *
156 *
157 *
158 *
159 * CURLINFO_HEADER_SIZE - Total size of all headers received
160 *
161 *
162 *
163 *
164 * CURLINFO_HEADER_OUT - The request string sent. For this to
165 * work, add the CURLINFO_HEADER_OUT option to the handle by calling
166 * curl_setopt
167 *
168 *
169 *
170 *
171 * CURLINFO_REQUEST_SIZE - Total size of issued requests, currently only for HTTP requests
172 *
173 *
174 *
175 *
176 * CURLINFO_SSL_VERIFYRESULT - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
177 *
178 *
179 *
180 *
181 * CURLINFO_CONTENT_LENGTH_DOWNLOAD - Content length of download, read from Content-Length: field
182 *
183 *
184 *
185 *
186 * CURLINFO_CONTENT_LENGTH_UPLOAD - Specified size of upload
187 *
188 *
189 *
190 *
191 * CURLINFO_CONTENT_TYPE - Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header
192 *
193 *
194 *
195 *
196 * CURLINFO_PRIVATE - Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt
197 *
198 *
199 *
200 *
201 * CURLINFO_RESPONSE_CODE - The last response code
202 *
203 *
204 *
205 *
206 * CURLINFO_HTTP_CONNECTCODE - The CONNECT response code
207 *
208 *
209 *
210 *
211 * CURLINFO_HTTPAUTH_AVAIL - Bitmask indicating the authentication method(s) available according to the previous response
212 *
213 *
214 *
215 *
216 * CURLINFO_PROXYAUTH_AVAIL - Bitmask indicating the proxy authentication method(s) available according to the previous response
217 *
218 *
219 *
220 *
221 * CURLINFO_OS_ERRNO - Errno from a connect failure. The number is OS and system specific.
222 *
223 *
224 *
225 *
226 * CURLINFO_NUM_CONNECTS - Number of connections curl had to create to achieve the previous transfer
227 *
228 *
229 *
230 *
231 * CURLINFO_SSL_ENGINES - OpenSSL crypto-engines supported
232 *
233 *
234 *
235 *
236 * CURLINFO_COOKIELIST - All known cookies
237 *
238 *
239 *
240 *
241 * CURLINFO_FTP_ENTRY_PATH - Entry path in FTP server
242 *
243 *
244 *
245 *
246 * CURLINFO_APPCONNECT_TIME - Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed
247 *
248 *
249 *
250 *
251 * CURLINFO_CERTINFO - TLS certificate chain
252 *
253 *
254 *
255 *
256 * CURLINFO_CONDITION_UNMET - Info on unmet time conditional
257 *
258 *
259 *
260 *
261 * CURLINFO_RTSP_CLIENT_CSEQ - Next RTSP client CSeq
262 *
263 *
264 *
265 *
266 * CURLINFO_RTSP_CSEQ_RECV - Recently received CSeq
267 *
268 *
269 *
270 *
271 * CURLINFO_RTSP_SERVER_CSEQ - Next RTSP server CSeq
272 *
273 *
274 *
275 *
276 * CURLINFO_RTSP_SESSION_ID - RTSP session ID
277 *
278 *
279 *
280 *
281 * CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - The content-length of the download. This is the value read from the Content-Type: field. -1 if the size isn't known
282 *
283 *
284 *
285 *
286 * CURLINFO_CONTENT_LENGTH_UPLOAD_T - The specified size of the upload. -1 if the size isn't known
287 *
288 *
289 *
290 *
291 * CURLINFO_HTTP_VERSION - The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined
292 *
293 *
294 *
295 *
296 * CURLINFO_PROTOCOL - The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values
297 *
298 *
299 *
300 *
301 * CURLINFO_PROXY_SSL_VERIFYRESULT - The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies
302 *
303 *
304 *
305 *
306 * CURLINFO_SCHEME - The URL scheme used for the most recent connection
307 *
308 *
309 *
310 *
311 * CURLINFO_SIZE_DOWNLOAD_T - Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer
312 *
313 *
314 *
315 *
316 * CURLINFO_SIZE_UPLOAD_T - Total number of bytes that were uploaded
317 *
318 *
319 *
320 *
321 * CURLINFO_SPEED_DOWNLOAD_T - The average download speed in bytes/second that curl measured for the complete download
322 *
323 *
324 *
325 *
326 * CURLINFO_SPEED_UPLOAD_T - The average upload speed in bytes/second that curl measured for the complete upload
327 *
328 *
329 *
330 *
331 * CURLINFO_APPCONNECT_TIME_T - Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed
332 *
333 *
334 *
335 *
336 * CURLINFO_CONNECT_TIME_T - Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed
337 *
338 *
339 *
340 *
341 * CURLINFO_FILETIME_T - Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range
342 *
343 *
344 *
345 *
346 * CURLINFO_NAMELOOKUP_TIME_T - Time in microseconds from the start until the name resolving was completed
347 *
348 *
349 *
350 *
351 * CURLINFO_PRETRANSFER_TIME_T - Time taken from the start until the file transfer is just about to begin, in microseconds
352 *
353 *
354 *
355 *
356 * CURLINFO_REDIRECT_TIME_T - Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started
357 *
358 *
359 *
360 *
361 * CURLINFO_STARTTRANSFER_TIME_T - Time, in microseconds, it took from the start until the first byte is received
362 *
363 *
364 *
365 *
366 * CURLINFO_TOTAL_TIME_T - Total time in microseconds for the previous transfer, including name resolving, TCP connect etc.
367 *
368 *
369 *
370 * @return mixed If opt is given, returns its value.
371 * Otherwise, returns an associative array with the following elements
372 * (which correspond to opt):
373 *
374 *
375 *
376 * "url"
377 *
378 *
379 *
380 *
381 * "content_type"
382 *
383 *
384 *
385 *
386 * "http_code"
387 *
388 *
389 *
390 *
391 * "header_size"
392 *
393 *
394 *
395 *
396 * "request_size"
397 *
398 *
399 *
400 *
401 * "filetime"
402 *
403 *
404 *
405 *
406 * "ssl_verify_result"
407 *
408 *
409 *
410 *
411 * "redirect_count"
412 *
413 *
414 *
415 *
416 * "total_time"
417 *
418 *
419 *
420 *
421 * "namelookup_time"
422 *
423 *
424 *
425 *
426 * "connect_time"
427 *
428 *
429 *
430 *
431 * "pretransfer_time"
432 *
433 *
434 *
435 *
436 * "size_upload"
437 *
438 *
439 *
440 *
441 * "size_download"
442 *
443 *
444 *
445 *
446 * "speed_download"
447 *
448 *
449 *
450 *
451 * "speed_upload"
452 *
453 *
454 *
455 *
456 * "download_content_length"
457 *
458 *
459 *
460 *
461 * "upload_content_length"
462 *
463 *
464 *
465 *
466 * "starttransfer_time"
467 *
468 *
469 *
470 *
471 * "redirect_time"
472 *
473 *
474 *
475 *
476 * "certinfo"
477 *
478 *
479 *
480 *
481 * "primary_ip"
482 *
483 *
484 *
485 *
486 * "primary_port"
487 *
488 *
489 *
490 *
491 * "local_ip"
492 *
493 *
494 *
495 *
496 * "local_port"
497 *
498 *
499 *
500 *
501 * "redirect_url"
502 *
503 *
504 *
505 *
506 * "request_header" (This is only set if the CURLINFO_HEADER_OUT
507 * is set by a previous call to curl_setopt)
508 *
509 *
510 *
511 * Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option.
512 * @throws CurlException
513 *
514 */
515 function curl_getinfo($ch, ?int $opt = null)
516 {
517 error_clear_last();
518 if ($opt !== null) {
519 $result = \curl_getinfo($ch, $opt);
520 } else {
521 $result = \curl_getinfo($ch);
522 }
523 if ($result === false) {
524 throw CurlException::createFromCurlResource($ch);
525 }
526 return $result;
527 }
528
529
530 /**
531 * Initializes a new session and return a cURL handle for use with the
532 * curl_setopt, curl_exec,
533 * and curl_close functions.
534 *
535 * @param string|null $url If provided, the CURLOPT_URL option will be set
536 * to its value. You can manually set this using the
537 * curl_setopt function.
538 *
539 * The file protocol is disabled by cURL if
540 * open_basedir is set.
541 *
542 * @return resource Returns a cURL handle on success, FALSE on errors.
543 * @throws CurlException
544 *
545 */
546 function curl_init(?string $url = null)
547 {
548 error_clear_last();
549 $result = \curl_init($url);
550 if ($result === false) {
551 throw CurlException::createFromPhpError();
552 }
553 return $result;
554 }
555
556
557 /**
558 * Return an integer containing the last multi curl error number.
559 *
560 * @param resource $mh A cURL multi handle returned by
561 * curl_multi_init.
562 * @return int Return an integer containing the last multi curl error number.
563 * @throws CurlException
564 *
565 */
566 function curl_multi_errno($mh): int
567 {
568 error_clear_last();
569 $result = \curl_multi_errno($mh);
570 if ($result === false) {
571 throw CurlException::createFromPhpError();
572 }
573 return $result;
574 }
575
576
577 /**
578 * Ask the multi handle if there are any messages or information from the individual transfers.
579 * Messages may include information such as an error code from the transfer or just the fact
580 * that a transfer is completed.
581 *
582 * Repeated calls to this function will return a new result each time, until a FALSE is returned
583 * as a signal that there is no more to get at this point. The integer pointed to with
584 * msgs_in_queue will contain the number of remaining messages after this
585 * function was called.
586 *
587 * @param resource $mh A cURL multi handle returned by
588 * curl_multi_init.
589 * @param int|null $msgs_in_queue Number of messages that are still in the queue
590 * @return array On success, returns an associative array for the message, FALSE on failure.
591 *
592 *
593 * Contents of the returned array
594 *
595 *
596 *
597 * Key:
598 * Value:
599 *
600 *
601 *
602 *
603 * msg
604 * The CURLMSG_DONE constant. Other return values
605 * are currently not available.
606 *
607 *
608 * result
609 * One of the CURLE_* constants. If everything is
610 * OK, the CURLE_OK will be the result.
611 *
612 *
613 * handle
614 * Resource of type curl indicates the handle which it concerns.
615 *
616 *
617 *
618 *
619 * @throws CurlException
620 *
621 */
622 function curl_multi_info_read($mh, ?int &$msgs_in_queue = null): array
623 {
624 error_clear_last();
625 $result = \curl_multi_info_read($mh, $msgs_in_queue);
626 if ($result === false) {
627 throw CurlException::createFromPhpError();
628 }
629 return $result;
630 }
631
632
633 /**
634 * Allows the processing of multiple cURL handles asynchronously.
635 *
636 * @return resource Returns a cURL multi handle resource on success, FALSE on failure.
637 * @throws CurlException
638 *
639 */
640 function curl_multi_init()
641 {
642 error_clear_last();
643 $result = \curl_multi_init();
644 if ($result === false) {
645 throw CurlException::createFromPhpError();
646 }
647 return $result;
648 }
649
650
651 /**
652 * Sets an option on the given cURL session handle.
653 *
654 * @param resource $ch A cURL handle returned by
655 * curl_init.
656 * @param int $option The CURLOPT_XXX option to set.
657 * @param mixed $value The value to be set on option.
658 *
659 * value should be a bool for the
660 * following values of the option parameter:
661 *
662 *
663 *
664 *
665 * Option
666 * Set value to
667 * Notes
668 *
669 *
670 *
671 *
672 * CURLOPT_AUTOREFERER
673 *
674 * TRUE to automatically set the Referer: field in
675 * requests where it follows a Location: redirect.
676 *
677 *
678 *
679 *
680 *
681 * CURLOPT_BINARYTRANSFER
682 *
683 * TRUE to return the raw output when
684 * CURLOPT_RETURNTRANSFER is used.
685 *
686 *
687 * From PHP 5.1.3, this option has no effect: the raw output will
688 * always be returned when
689 * CURLOPT_RETURNTRANSFER is used.
690 *
691 *
692 *
693 * CURLOPT_COOKIESESSION
694 *
695 * TRUE to mark this as a new cookie "session". It will force libcurl
696 * to ignore all cookies it is about to load that are "session cookies"
697 * from the previous session. By default, libcurl always stores and
698 * loads all cookies, independent if they are session cookies or not.
699 * Session cookies are cookies without expiry date and they are meant
700 * to be alive and existing for this "session" only.
701 *
702 *
703 *
704 *
705 *
706 * CURLOPT_CERTINFO
707 *
708 * TRUE to output SSL certification information to STDERR
709 * on secure transfers.
710 *
711 *
712 * Added in cURL 7.19.1.
713 * Available since PHP 5.3.2.
714 * Requires CURLOPT_VERBOSE to be on to have an effect.
715 *
716 *
717 *
718 * CURLOPT_CONNECT_ONLY
719 *
720 * TRUE tells the library to perform all the required proxy authentication
721 * and connection setup, but no data transfer. This option is implemented for
722 * HTTP, SMTP and POP3.
723 *
724 *
725 * Added in 7.15.2.
726 * Available since PHP 5.5.0.
727 *
728 *
729 *
730 * CURLOPT_CRLF
731 *
732 * TRUE to convert Unix newlines to CRLF newlines
733 * on transfers.
734 *
735 *
736 *
737 *
738 *
739 * CURLOPT_DISALLOW_USERNAME_IN_URL
740 *
741 * TRUE to not allow URLs that include a username. Usernames are allowed by default (0).
742 *
743 *
744 * Added in cURL 7.61.0. Available since PHP 7.3.0.
745 *
746 *
747 *
748 * CURLOPT_DNS_SHUFFLE_ADDRESSES
749 *
750 * TRUE to shuffle the order of all returned addresses so that they will be used
751 * in a random order, when a name is resolved and more than one IP address is returned.
752 * This may cause IPv4 to be used before IPv6 or vice versa.
753 *
754 *
755 * Added in cURL 7.60.0. Available since PHP 7.3.0.
756 *
757 *
758 *
759 * CURLOPT_HAPROXYPROTOCOL
760 *
761 * TRUE to send an HAProxy PROXY protocol v1 header at the start of the connection.
762 * The default action is not to send this header.
763 *
764 *
765 * Added in cURL 7.60.0. Available since PHP 7.3.0.
766 *
767 *
768 *
769 * CURLOPT_SSH_COMPRESSION
770 *
771 * TRUE to enable built-in SSH compression. This is a request, not an order;
772 * the server may or may not do it.
773 *
774 *
775 * Added in cURL 7.56.0. Available since PHP 7.3.0.
776 *
777 *
778 *
779 * CURLOPT_DNS_USE_GLOBAL_CACHE
780 *
781 * TRUE to use a global DNS cache. This option is not thread-safe.
782 * It is conditionally enabled by default if PHP is built for non-threaded use
783 * (CLI, FCGI, Apache2-Prefork, etc.).
784 *
785 *
786 *
787 *
788 *
789 * CURLOPT_FAILONERROR
790 *
791 * TRUE to fail verbosely if the HTTP code returned
792 * is greater than or equal to 400. The default behavior is to return
793 * the page normally, ignoring the code.
794 *
795 *
796 *
797 *
798 *
799 * CURLOPT_SSL_FALSESTART
800 *
801 * TRUE to enable TLS false start.
802 *
803 *
804 * Added in cURL 7.42.0. Available since PHP 7.0.7.
805 *
806 *
807 *
808 * CURLOPT_FILETIME
809 *
810 * TRUE to attempt to retrieve the modification
811 * date of the remote document. This value can be retrieved using
812 * the CURLINFO_FILETIME option with
813 * curl_getinfo.
814 *
815 *
816 *
817 *
818 *
819 * CURLOPT_FOLLOWLOCATION
820 *
821 * TRUE to follow any
822 * "Location: " header that the server sends as
823 * part of the HTTP header (note this is recursive, PHP will follow as
824 * many "Location: " headers that it is sent,
825 * unless CURLOPT_MAXREDIRS is set).
826 *
827 *
828 *
829 *
830 *
831 * CURLOPT_FORBID_REUSE
832 *
833 * TRUE to force the connection to explicitly
834 * close when it has finished processing, and not be pooled for reuse.
835 *
836 *
837 *
838 *
839 *
840 * CURLOPT_FRESH_CONNECT
841 *
842 * TRUE to force the use of a new connection
843 * instead of a cached one.
844 *
845 *
846 *
847 *
848 *
849 * CURLOPT_FTP_USE_EPRT
850 *
851 * TRUE to use EPRT (and LPRT) when doing active
852 * FTP downloads. Use FALSE to disable EPRT and LPRT and use PORT
853 * only.
854 *
855 *
856 *
857 *
858 *
859 * CURLOPT_FTP_USE_EPSV
860 *
861 * TRUE to first try an EPSV command for FTP
862 * transfers before reverting back to PASV. Set to FALSE
863 * to disable EPSV.
864 *
865 *
866 *
867 *
868 *
869 * CURLOPT_FTP_CREATE_MISSING_DIRS
870 *
871 * TRUE to create missing directories when an FTP operation
872 * encounters a path that currently doesn't exist.
873 *
874 *
875 *
876 *
877 *
878 * CURLOPT_FTPAPPEND
879 *
880 * TRUE to append to the remote file instead of
881 * overwriting it.
882 *
883 *
884 *
885 *
886 *
887 * CURLOPT_TCP_NODELAY
888 *
889 * TRUE to disable TCP's Nagle algorithm, which tries to minimize
890 * the number of small packets on the network.
891 *
892 *
893 * Available since PHP 5.2.1 for versions compiled with libcurl 7.11.2 or
894 * greater.
895 *
896 *
897 *
898 * CURLOPT_FTPASCII
899 *
900 * An alias of
901 * CURLOPT_TRANSFERTEXT. Use that instead.
902 *
903 *
904 *
905 *
906 *
907 * CURLOPT_FTPLISTONLY
908 *
909 * TRUE to only list the names of an FTP
910 * directory.
911 *
912 *
913 *
914 *
915 *
916 * CURLOPT_HEADER
917 *
918 * TRUE to include the header in the output.
919 *
920 *
921 *
922 *
923 *
924 * CURLINFO_HEADER_OUT
925 *
926 * TRUE to track the handle's request string.
927 *
928 *
929 * Available since PHP 5.1.3. The CURLINFO_
930 * prefix is intentional.
931 *
932 *
933 *
934 * CURLOPT_HTTP09_ALLOWED
935 *
936 * Whether to allow HTTP/0.9 responses. Defaults to FALSE as of libcurl 7.66.0;
937 * formerly it defaulted to TRUE.
938 *
939 *
940 * Available since PHP 7.3.15 and 7.4.3, respectively, if built against libcurl &gt;= 7.64.0
941 *
942 *
943 *
944 * CURLOPT_HTTPGET
945 *
946 * TRUE to reset the HTTP request method to GET.
947 * Since GET is the default, this is only necessary if the request
948 * method has been changed.
949 *
950 *
951 *
952 *
953 *
954 * CURLOPT_HTTPPROXYTUNNEL
955 *
956 * TRUE to tunnel through a given HTTP proxy.
957 *
958 *
959 *
960 *
961 *
962 * CURLOPT_HTTP_CONTENT_DECODING
963 *
964 * FALSE to get the raw HTTP response body.
965 *
966 *
967 * Available as of PHP 5.5.0 if built against libcurl &gt;= 7.16.2.
968 *
969 *
970 *
971 * CURLOPT_KEEP_SENDING_ON_ERROR
972 *
973 * TRUE to keep sending the request body if the HTTP code returned is
974 * equal to or larger than 300. The default action would be to stop sending
975 * and close the stream or connection. Suitable for manual NTLM authentication.
976 * Most applications do not need this option.
977 *
978 *
979 * Available as of PHP 7.3.0 if built against libcurl &gt;= 7.51.0.
980 *
981 *
982 *
983 * CURLOPT_MUTE
984 *
985 * TRUE to be completely silent with regards to
986 * the cURL functions.
987 *
988 *
989 * Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead)
990 *
991 *
992 *
993 * CURLOPT_NETRC
994 *
995 * TRUE to scan the ~/.netrc
996 * file to find a username and password for the remote site that
997 * a connection is being established with.
998 *
999 *
1000 *
1001 *
1002 *
1003 * CURLOPT_NOBODY
1004 *
1005 * TRUE to exclude the body from the output.
1006 * Request method is then set to HEAD. Changing this to FALSE does
1007 * not change it to GET.
1008 *
1009 *
1010 *
1011 *
1012 *
1013 * CURLOPT_NOPROGRESS
1014 *
1015 * TRUE to disable the progress meter for cURL transfers.
1016 *
1017 *
1018 * PHP automatically sets this option to TRUE, this should only be
1019 * changed for debugging purposes.
1020 *
1021 *
1022 *
1023 *
1024 *
1025 *
1026 *
1027 * CURLOPT_NOSIGNAL
1028 *
1029 * TRUE to ignore any cURL function that causes a
1030 * signal to be sent to the PHP process. This is turned on by default
1031 * in multi-threaded SAPIs so timeout options can still be used.
1032 *
1033 *
1034 * Added in cURL 7.10.
1035 *
1036 *
1037 *
1038 * CURLOPT_PATH_AS_IS
1039 *
1040 * TRUE to not handle dot dot sequences.
1041 *
1042 *
1043 * Added in cURL 7.42.0. Available since PHP 7.0.7.
1044 *
1045 *
1046 *
1047 * CURLOPT_PIPEWAIT
1048 *
1049 * TRUE to wait for pipelining/multiplexing.
1050 *
1051 *
1052 * Added in cURL 7.43.0. Available since PHP 7.0.7.
1053 *
1054 *
1055 *
1056 * CURLOPT_POST
1057 *
1058 * TRUE to do a regular HTTP POST. This POST is the
1059 * normal application/x-www-form-urlencoded kind,
1060 * most commonly used by HTML forms.
1061 *
1062 *
1063 *
1064 *
1065 *
1066 * CURLOPT_PUT
1067 *
1068 * TRUE to HTTP PUT a file. The file to PUT must
1069 * be set with CURLOPT_INFILE and
1070 * CURLOPT_INFILESIZE.
1071 *
1072 *
1073 *
1074 *
1075 *
1076 * CURLOPT_RETURNTRANSFER
1077 *
1078 * TRUE to return the transfer as a string of the
1079 * return value of curl_exec instead of outputting
1080 * it directly.
1081 *
1082 *
1083 *
1084 *
1085 *
1086 * CURLOPT_SAFE_UPLOAD
1087 *
1088 * TRUE to disable support for the @ prefix for
1089 * uploading files in CURLOPT_POSTFIELDS, which
1090 * means that values starting with @ can be safely
1091 * passed as fields. CURLFile may be used for
1092 * uploads instead.
1093 *
1094 *
1095 * Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0
1096 * changes the default value to TRUE. PHP 7 removes this option;
1097 * the CURLFile interface must be used to upload files.
1098 *
1099 *
1100 *
1101 * CURLOPT_SASL_IR
1102 *
1103 * TRUE to enable sending the initial response in the first packet.
1104 *
1105 *
1106 * Added in cURL 7.31.10. Available since PHP 7.0.7.
1107 *
1108 *
1109 *
1110 * CURLOPT_SSL_ENABLE_ALPN
1111 *
1112 * FALSE to disable ALPN in the SSL handshake (if the SSL backend
1113 * libcurl is built to use supports it), which can be used to
1114 * negotiate http2.
1115 *
1116 *
1117 * Added in cURL 7.36.0. Available since PHP 7.0.7.
1118 *
1119 *
1120 *
1121 * CURLOPT_SSL_ENABLE_NPN
1122 *
1123 * FALSE to disable NPN in the SSL handshake (if the SSL backend
1124 * libcurl is built to use supports it), which can be used to
1125 * negotiate http2.
1126 *
1127 *
1128 * Added in cURL 7.36.0. Available since PHP 7.0.7.
1129 *
1130 *
1131 *
1132 * CURLOPT_SSL_VERIFYPEER
1133 *
1134 * FALSE to stop cURL from verifying the peer's
1135 * certificate. Alternate certificates to verify against can be
1136 * specified with the CURLOPT_CAINFO option
1137 * or a certificate directory can be specified with the
1138 * CURLOPT_CAPATH option.
1139 *
1140 *
1141 * TRUE by default as of cURL 7.10. Default bundle installed as of
1142 * cURL 7.10.
1143 *
1144 *
1145 *
1146 * CURLOPT_SSL_VERIFYSTATUS
1147 *
1148 * TRUE to verify the certificate's status.
1149 *
1150 *
1151 * Added in cURL 7.41.0. Available since PHP 7.0.7.
1152 *
1153 *
1154 *
1155 * CURLOPT_PROXY_SSL_VERIFYPEER
1156 *
1157 * FALSE to stop cURL from verifying the peer's certificate.
1158 * Alternate certificates to verify against can be
1159 * specified with the CURLOPT_CAINFO option
1160 * or a certificate directory can be specified with the
1161 * CURLOPT_CAPATH option.
1162 * When set to false, the peer certificate verification succeeds regardless.
1163 *
1164 *
1165 * TRUE by default. Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
1166 *
1167 *
1168 *
1169 * CURLOPT_SUPPRESS_CONNECT_HEADERS
1170 *
1171 * TRUE to suppress proxy CONNECT response headers from the user callback functions
1172 * CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION,
1173 * when CURLOPT_HTTPPROXYTUNNEL is used and a CONNECT request is made.
1174 *
1175 *
1176 * Added in cURL 7.54.0. Available since PHP 7.3.0.
1177 *
1178 *
1179 *
1180 * CURLOPT_TCP_FASTOPEN
1181 *
1182 * TRUE to enable TCP Fast Open.
1183 *
1184 *
1185 * Added in cURL 7.49.0. Available since PHP 7.0.7.
1186 *
1187 *
1188 *
1189 * CURLOPT_TFTP_NO_OPTIONS
1190 *
1191 * TRUE to not send TFTP options requests.
1192 *
1193 *
1194 * Added in cURL 7.48.0. Available since PHP 7.0.7.
1195 *
1196 *
1197 *
1198 * CURLOPT_TRANSFERTEXT
1199 *
1200 * TRUE to use ASCII mode for FTP transfers.
1201 * For LDAP, it retrieves data in plain text instead of HTML. On
1202 * Windows systems, it will not set STDOUT to binary
1203 * mode.
1204 *
1205 *
1206 *
1207 *
1208 *
1209 * CURLOPT_UNRESTRICTED_AUTH
1210 *
1211 * TRUE to keep sending the username and password
1212 * when following locations (using
1213 * CURLOPT_FOLLOWLOCATION), even when the
1214 * hostname has changed.
1215 *
1216 *
1217 *
1218 *
1219 *
1220 * CURLOPT_UPLOAD
1221 *
1222 * TRUE to prepare for an upload.
1223 *
1224 *
1225 *
1226 *
1227 *
1228 * CURLOPT_VERBOSE
1229 *
1230 * TRUE to output verbose information. Writes
1231 * output to STDERR, or the file specified using
1232 * CURLOPT_STDERR.
1233 *
1234 *
1235 *
1236 *
1237 *
1238 *
1239 *
1240 *
1241 * TRUE to disable the progress meter for cURL transfers.
1242 *
1243 *
1244 * PHP automatically sets this option to TRUE, this should only be
1245 * changed for debugging purposes.
1246 *
1247 *
1248 *
1249 * PHP automatically sets this option to TRUE, this should only be
1250 * changed for debugging purposes.
1251 *
1252 * value should be an integer for the
1253 * following values of the option parameter:
1254 *
1255 *
1256 *
1257 *
1258 * Option
1259 * Set value to
1260 * Notes
1261 *
1262 *
1263 *
1264 *
1265 * CURLOPT_BUFFERSIZE
1266 *
1267 * The size of the buffer to use for each read. There is no guarantee
1268 * this request will be fulfilled, however.
1269 *
1270 *
1271 * Added in cURL 7.10.
1272 *
1273 *
1274 *
1275 * CURLOPT_CLOSEPOLICY
1276 *
1277 * One of the CURLCLOSEPOLICY_* values.
1278 *
1279 *
1280 * This option is deprecated, as it was never implemented in cURL and
1281 * never had any effect.
1282 *
1283 *
1284 *
1285 *
1286 * Removed in PHP 5.6.0.
1287 *
1288 *
1289 *
1290 * CURLOPT_CONNECTTIMEOUT
1291 *
1292 * The number of seconds to wait while trying to connect. Use 0 to
1293 * wait indefinitely.
1294 *
1295 *
1296 *
1297 *
1298 *
1299 * CURLOPT_CONNECTTIMEOUT_MS
1300 *
1301 * The number of milliseconds to wait while trying to connect. Use 0 to
1302 * wait indefinitely.
1303 *
1304 * If libcurl is built to use the standard system name resolver, that
1305 * portion of the connect will still use full-second resolution for
1306 * timeouts with a minimum timeout allowed of one second.
1307 *
1308 *
1309 * Added in cURL 7.16.2. Available since PHP 5.2.3.
1310 *
1311 *
1312 *
1313 * CURLOPT_DNS_CACHE_TIMEOUT
1314 *
1315 * The number of seconds to keep DNS entries in memory. This
1316 * option is set to 120 (2 minutes) by default.
1317 *
1318 *
1319 *
1320 *
1321 *
1322 * CURLOPT_EXPECT_100_TIMEOUT_MS
1323 *
1324 * The timeout for Expect: 100-continue responses in milliseconds.
1325 * Defaults to 1000 milliseconds.
1326 *
1327 *
1328 * Added in cURL 7.36.0. Available since PHP 7.0.7.
1329 *
1330 *
1331 *
1332 * CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
1333 *
1334 * Head start for ipv6 for the happy eyeballs algorithm. Happy eyeballs attempts
1335 * to connect to both IPv4 and IPv6 addresses for dual-stack hosts,
1336 * preferring IPv6 first for timeout milliseconds.
1337 * Defaults to CURL_HET_DEFAULT, which is currently 200 milliseconds.
1338 *
1339 *
1340 * Added in cURL 7.59.0. Available since PHP 7.3.0.
1341 *
1342 *
1343 *
1344 * CURLOPT_FTPSSLAUTH
1345 *
1346 * The FTP authentication method (when is activated):
1347 * CURLFTPAUTH_SSL (try SSL first),
1348 * CURLFTPAUTH_TLS (try TLS first), or
1349 * CURLFTPAUTH_DEFAULT (let cURL decide).
1350 *
1351 *
1352 * Added in cURL 7.12.2.
1353 *
1354 *
1355 *
1356 * CURLOPT_HEADEROPT
1357 *
1358 * How to deal with headers. One of the following constants:
1359 *
1360 * CURLHEADER_UNIFIED: the headers specified in
1361 * CURLOPT_HTTPHEADER will be used in requests
1362 * both to servers and proxies. With this option enabled,
1363 * CURLOPT_PROXYHEADER will not have any effect.
1364 *
1365 *
1366 * CURLHEADER_SEPARATE: makes
1367 * CURLOPT_HTTPHEADER headers only get sent to
1368 * a server and not to a proxy. Proxy headers must be set with
1369 * CURLOPT_PROXYHEADER to get used. Note that if
1370 * a non-CONNECT request is sent to a proxy, libcurl will send both
1371 * server headers and proxy headers. When doing CONNECT, libcurl will
1372 * send CURLOPT_PROXYHEADER headers only to the
1373 * proxy and then CURLOPT_HTTPHEADER headers
1374 * only to the server.
1375 *
1376 *
1377 * Defaults to CURLHEADER_SEPARATE as of cURL
1378 * 7.42.1, and CURLHEADER_UNIFIED before.
1379 *
1380 *
1381 *
1382 * Added in cURL 7.37.0. Available since PHP 7.0.7.
1383 *
1384 *
1385 *
1386 * CURLOPT_HTTP_VERSION
1387 *
1388 * CURL_HTTP_VERSION_NONE (default, lets CURL
1389 * decide which version to use),
1390 * CURL_HTTP_VERSION_1_0 (forces HTTP/1.0),
1391 * CURL_HTTP_VERSION_1_1 (forces HTTP/1.1),
1392 * CURL_HTTP_VERSION_2_0 (attempts HTTP 2),
1393 * CURL_HTTP_VERSION_2 (alias of CURL_HTTP_VERSION_2_0),
1394 * CURL_HTTP_VERSION_2TLS (attempts HTTP 2 over TLS (HTTPS) only) or
1395 * CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE (issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade).
1396 *
1397 *
1398 *
1399 *
1400 *
1401 * CURLOPT_HTTPAUTH
1402 *
1403 *
1404 * The HTTP authentication method(s) to use. The options are:
1405 * CURLAUTH_BASIC,
1406 * CURLAUTH_DIGEST,
1407 * CURLAUTH_GSSNEGOTIATE,
1408 * CURLAUTH_NTLM,
1409 * CURLAUTH_ANY, and
1410 * CURLAUTH_ANYSAFE.
1411 *
1412 *
1413 * The bitwise | (or) operator can be used to combine
1414 * more than one method. If this is done, cURL will poll the server to see
1415 * what methods it supports and pick the best one.
1416 *
1417 *
1418 * CURLAUTH_ANY is an alias for
1419 * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
1420 *
1421 *
1422 * CURLAUTH_ANYSAFE is an alias for
1423 * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
1424 *
1425 *
1426 *
1427 *
1428 *
1429 *
1430 * CURLOPT_INFILESIZE
1431 *
1432 * The expected size, in bytes, of the file when uploading a file to
1433 * a remote site. Note that using this option will not stop libcurl
1434 * from sending more data, as exactly what is sent depends on
1435 * CURLOPT_READFUNCTION.
1436 *
1437 *
1438 *
1439 *
1440 *
1441 * CURLOPT_LOW_SPEED_LIMIT
1442 *
1443 * The transfer speed, in bytes per second, that the transfer should be
1444 * below during the count of CURLOPT_LOW_SPEED_TIME
1445 * seconds before PHP considers the transfer too slow and aborts.
1446 *
1447 *
1448 *
1449 *
1450 *
1451 * CURLOPT_LOW_SPEED_TIME
1452 *
1453 * The number of seconds the transfer speed should be below
1454 * CURLOPT_LOW_SPEED_LIMIT before PHP considers
1455 * the transfer too slow and aborts.
1456 *
1457 *
1458 *
1459 *
1460 *
1461 * CURLOPT_MAXCONNECTS
1462 *
1463 * The maximum amount of persistent connections that are allowed.
1464 * When the limit is reached,
1465 * CURLOPT_CLOSEPOLICY is used to determine
1466 * which connection to close.
1467 *
1468 *
1469 *
1470 *
1471 *
1472 * CURLOPT_MAXREDIRS
1473 *
1474 * The maximum amount of HTTP redirections to follow. Use this option
1475 * alongside CURLOPT_FOLLOWLOCATION.
1476 *
1477 *
1478 *
1479 *
1480 *
1481 * CURLOPT_PORT
1482 *
1483 * An alternative port number to connect to.
1484 *
1485 *
1486 *
1487 *
1488 *
1489 * CURLOPT_POSTREDIR
1490 *
1491 * A bitmask of 1 (301 Moved Permanently), 2 (302 Found)
1492 * and 4 (303 See Other) if the HTTP POST method should be maintained
1493 * when CURLOPT_FOLLOWLOCATION is set and a
1494 * specific type of redirect occurs.
1495 *
1496 *
1497 * Added in cURL 7.19.1. Available since PHP 5.3.2.
1498 *
1499 *
1500 *
1501 * CURLOPT_PROTOCOLS
1502 *
1503 *
1504 * Bitmask of CURLPROTO_* values. If used, this bitmask
1505 * limits what protocols libcurl may use in the transfer. This allows you to have
1506 * a libcurl built to support a wide range of protocols but still limit specific
1507 * transfers to only be allowed to use a subset of them. By default libcurl will
1508 * accept all protocols it supports.
1509 * See also CURLOPT_REDIR_PROTOCOLS.
1510 *
1511 *
1512 * Valid protocol options are:
1513 * CURLPROTO_HTTP,
1514 * CURLPROTO_HTTPS,
1515 * CURLPROTO_FTP,
1516 * CURLPROTO_FTPS,
1517 * CURLPROTO_SCP,
1518 * CURLPROTO_SFTP,
1519 * CURLPROTO_TELNET,
1520 * CURLPROTO_LDAP,
1521 * CURLPROTO_LDAPS,
1522 * CURLPROTO_DICT,
1523 * CURLPROTO_FILE,
1524 * CURLPROTO_TFTP,
1525 * CURLPROTO_ALL
1526 *
1527 *
1528 *
1529 * Added in cURL 7.19.4.
1530 *
1531 *
1532 *
1533 * CURLOPT_PROXYAUTH
1534 *
1535 * The HTTP authentication method(s) to use for the proxy connection.
1536 * Use the same bitmasks as described in
1537 * CURLOPT_HTTPAUTH. For proxy authentication,
1538 * only CURLAUTH_BASIC and
1539 * CURLAUTH_NTLM are currently supported.
1540 *
1541 *
1542 * Added in cURL 7.10.7.
1543 *
1544 *
1545 *
1546 * CURLOPT_PROXYPORT
1547 *
1548 * The port number of the proxy to connect to. This port number can
1549 * also be set in CURLOPT_PROXY.
1550 *
1551 *
1552 *
1553 *
1554 *
1555 * CURLOPT_PROXYTYPE
1556 *
1557 * Either CURLPROXY_HTTP (default),
1558 * CURLPROXY_SOCKS4,
1559 * CURLPROXY_SOCKS5,
1560 * CURLPROXY_SOCKS4A or
1561 * CURLPROXY_SOCKS5_HOSTNAME.
1562 *
1563 *
1564 * Added in cURL 7.10.
1565 *
1566 *
1567 *
1568 * CURLOPT_REDIR_PROTOCOLS
1569 *
1570 * Bitmask of CURLPROTO_* values. If used, this bitmask
1571 * limits what protocols libcurl may use in a transfer that it follows to in
1572 * a redirect when CURLOPT_FOLLOWLOCATION is enabled.
1573 * This allows you to limit specific transfers to only be allowed to use a subset
1574 * of protocols in redirections. By default libcurl will allow all protocols
1575 * except for FILE and SCP. This is a difference compared to pre-7.19.4 versions
1576 * which unconditionally would follow to all protocols supported.
1577 * See also CURLOPT_PROTOCOLS for protocol constant values.
1578 *
1579 *
1580 * Added in cURL 7.19.4.
1581 *
1582 *
1583 *
1584 * CURLOPT_RESUME_FROM
1585 *
1586 * The offset, in bytes, to resume a transfer from.
1587 *
1588 *
1589 *
1590 *
1591 *
1592 * CURLOPT_SOCKS5_AUTH
1593 *
1594 *
1595 * The SOCKS5 authentication method(s) to use. The options are:
1596 * CURLAUTH_BASIC,
1597 * CURLAUTH_GSSAPI,
1598 * CURLAUTH_NONE.
1599 *
1600 *
1601 * The bitwise | (or) operator can be used to combine
1602 * more than one method. If this is done, cURL will poll the server to see
1603 * what methods it supports and pick the best one.
1604 *
1605 *
1606 * CURLAUTH_BASIC allows username/password authentication.
1607 *
1608 *
1609 * CURLAUTH_GSSAPI allows GSS-API authentication.
1610 *
1611 *
1612 * CURLAUTH_NONE allows no authentication.
1613 *
1614 *
1615 * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI.
1616 * Set the actual username and password with the CURLOPT_PROXYUSERPWD option.
1617 *
1618 *
1619 *
1620 * Available as of 7.3.0 and curl &gt;= 7.55.0.
1621 *
1622 *
1623 *
1624 * CURLOPT_SSL_OPTIONS
1625 *
1626 * Set SSL behavior options, which is a bitmask of any of the following constants:
1627 *
1628 * CURLSSLOPT_ALLOW_BEAST: do not attempt to use
1629 * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
1630 *
1631 *
1632 * CURLSSLOPT_NO_REVOKE: disable certificate
1633 * revocation checks for those SSL backends where such behavior is
1634 * present.
1635 *
1636 *
1637 *
1638 * Added in cURL 7.25.0. Available since PHP 7.0.7.
1639 *
1640 *
1641 *
1642 * CURLOPT_SSL_VERIFYHOST
1643 *
1644 * 1 to check the existence of a common name in the
1645 * SSL peer certificate. 2 to check the existence of
1646 * a common name and also verify that it matches the hostname
1647 * provided. 0 to not check the names. In production environments the value of this option
1648 * should be kept at 2 (default value).
1649 *
1650 *
1651 * Support for value 1 removed in cURL 7.28.1.
1652 *
1653 *
1654 *
1655 * CURLOPT_SSLVERSION
1656 *
1657 * One of CURL_SSLVERSION_DEFAULT (0),
1658 * CURL_SSLVERSION_TLSv1 (1),
1659 * CURL_SSLVERSION_SSLv2 (2),
1660 * CURL_SSLVERSION_SSLv3 (3),
1661 * CURL_SSLVERSION_TLSv1_0 (4),
1662 * CURL_SSLVERSION_TLSv1_1 (5) or
1663 * CURL_SSLVERSION_TLSv1_2 (6).
1664 * The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_*
1665 * constants. It is also possible to OR one of the CURL_SSLVERSION_*
1666 * constants with one of the CURL_SSLVERSION_MAX_* constants.
1667 * CURL_SSLVERSION_MAX_DEFAULT (the maximum version supported by the library),
1668 * CURL_SSLVERSION_MAX_TLSv1_0,
1669 * CURL_SSLVERSION_MAX_TLSv1_1,
1670 * CURL_SSLVERSION_MAX_TLSv1_2, or
1671 * CURL_SSLVERSION_MAX_TLSv1_3.
1672 *
1673 *
1674 * Your best bet is to not set this and let it use the default.
1675 * Setting it to 2 or 3 is very dangerous given the known
1676 * vulnerabilities in SSLv2 and SSLv3.
1677 *
1678 *
1679 *
1680 *
1681 *
1682 *
1683 *
1684 * CURLOPT_PROXY_SSL_OPTIONS
1685 *
1686 * Set proxy SSL behavior options, which is a bitmask of any of the following constants:
1687 *
1688 * CURLSSLOPT_ALLOW_BEAST: do not attempt to use
1689 * any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
1690 *
1691 *
1692 * CURLSSLOPT_NO_REVOKE: disable certificate
1693 * revocation checks for those SSL backends where such behavior is
1694 * present. (curl &gt;= 7.44.0)
1695 *
1696 *
1697 * CURLSSLOPT_NO_PARTIALCHAIN: do not accept "partial"
1698 * certificate chains, which it otherwise does by default. (curl &gt;= 7.68.0)
1699 *
1700 *
1701 *
1702 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
1703 *
1704 *
1705 *
1706 * CURLOPT_PROXY_SSL_VERIFYHOST
1707 *
1708 * Set to 2 to verify in the HTTPS proxy's certificate name fields against the proxy name.
1709 * When set to 0 the connection succeeds regardless of the names used in the certificate.
1710 * Use that ability with caution!
1711 * 1 treated as a debug option in curl 7.28.0 and earlier.
1712 * From curl 7.28.1 to 7.65.3 CURLE_BAD_FUNCTION_ARGUMENT is returned.
1713 * From curl 7.66.0 onwards 1 and 2 is treated as the same value.
1714 * In production environments the value of this option should be kept at 2 (default value).
1715 *
1716 *
1717 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
1718 *
1719 *
1720 *
1721 * CURLOPT_PROXY_SSLVERSION
1722 *
1723 * One of CURL_SSLVERSION_DEFAULT,
1724 * CURL_SSLVERSION_TLSv1,
1725 * CURL_SSLVERSION_TLSv1_0,
1726 * CURL_SSLVERSION_TLSv1_1,
1727 * CURL_SSLVERSION_TLSv1_2,
1728 * CURL_SSLVERSION_TLSv1_3,
1729 * CURL_SSLVERSION_MAX_DEFAULT,
1730 * CURL_SSLVERSION_MAX_TLSv1_0,
1731 * CURL_SSLVERSION_MAX_TLSv1_1,
1732 * CURL_SSLVERSION_MAX_TLSv1_2,
1733 * CURL_SSLVERSION_MAX_TLSv1_3 or
1734 * CURL_SSLVERSION_SSLv3.
1735 *
1736 *
1737 * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT
1738 * which will attempt to figure out the remote SSL protocol version.
1739 *
1740 *
1741 *
1742 *
1743 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
1744 *
1745 *
1746 *
1747 * CURLOPT_STREAM_WEIGHT
1748 *
1749 * Set the numerical stream weight (a number between 1 and 256).
1750 *
1751 *
1752 * Added in cURL 7.46.0. Available since PHP 7.0.7.
1753 *
1754 *
1755 *
1756 * CURLOPT_TCP_KEEPALIVE
1757 *
1758 * If set to 1, TCP keepalive probes will be sent. The delay and
1759 * frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE
1760 * and CURLOPT_TCP_KEEPINTVL options, provided the operating system
1761 * supports them. If set to 0 (default) keepalive probes are disabled.
1762 *
1763 *
1764 * Added in cURL 7.25.0. Available since PHP 5.5.0.
1765 *
1766 *
1767 *
1768 * CURLOPT_TCP_KEEPIDLE
1769 *
1770 * Sets the delay, in seconds, that the operating system will wait while the connection is
1771 * idle before sending keepalive probes, if CURLOPT_TCP_KEEPALIVE is
1772 * enabled. Not all operating systems support this option.
1773 * The default is 60.
1774 *
1775 *
1776 * Added in cURL 7.25.0. Available since PHP 5.5.0.
1777 *
1778 *
1779 *
1780 * CURLOPT_TCP_KEEPINTVL
1781 *
1782 * Sets the interval, in seconds, that the operating system will wait between sending
1783 * keepalive probes, if CURLOPT_TCP_KEEPALIVE is enabled.
1784 * Not all operating systems support this option.
1785 * The default is 60.
1786 *
1787 *
1788 * Added in cURL 7.25.0. Available since PHP 5.5.0.
1789 *
1790 *
1791 *
1792 * CURLOPT_TIMECONDITION
1793 *
1794 * How CURLOPT_TIMEVALUE is treated.
1795 * Use CURL_TIMECOND_IFMODSINCE to return the
1796 * page only if it has been modified since the time specified in
1797 * CURLOPT_TIMEVALUE. If it hasn't been modified,
1798 * a "304 Not Modified" header will be returned
1799 * assuming CURLOPT_HEADER is TRUE.
1800 * Use CURL_TIMECOND_IFUNMODSINCE for the reverse
1801 * effect. CURL_TIMECOND_IFMODSINCE is the
1802 * default.
1803 *
1804 *
1805 *
1806 *
1807 *
1808 * CURLOPT_TIMEOUT
1809 *
1810 * The maximum number of seconds to allow cURL functions to execute.
1811 *
1812 *
1813 *
1814 *
1815 *
1816 * CURLOPT_TIMEOUT_MS
1817 *
1818 * The maximum number of milliseconds to allow cURL functions to
1819 * execute.
1820 *
1821 * If libcurl is built to use the standard system name resolver, that
1822 * portion of the connect will still use full-second resolution for
1823 * timeouts with a minimum timeout allowed of one second.
1824 *
1825 *
1826 * Added in cURL 7.16.2. Available since PHP 5.2.3.
1827 *
1828 *
1829 *
1830 * CURLOPT_TIMEVALUE
1831 *
1832 * The time in seconds since January 1st, 1970. The time will be used
1833 * by CURLOPT_TIMECONDITION. By default,
1834 * CURL_TIMECOND_IFMODSINCE is used.
1835 *
1836 *
1837 *
1838 *
1839 *
1840 * CURLOPT_TIMEVALUE_LARGE
1841 *
1842 * The time in seconds since January 1st, 1970. The time will be used
1843 * by CURLOPT_TIMECONDITION. Defaults to zero.
1844 * The difference between this option and CURLOPT_TIMEVALUE
1845 * is the type of the argument. On systems where 'long' is only 32 bit wide,
1846 * this option has to be used to set dates beyond the year 2038.
1847 *
1848 *
1849 * Added in cURL 7.59.0. Available since PHP 7.3.0.
1850 *
1851 *
1852 *
1853 * CURLOPT_MAX_RECV_SPEED_LARGE
1854 *
1855 * If a download exceeds this speed (counted in bytes per second) on
1856 * cumulative average during the transfer, the transfer will pause to
1857 * keep the average rate less than or equal to the parameter value.
1858 * Defaults to unlimited speed.
1859 *
1860 *
1861 * Added in cURL 7.15.5. Available since PHP 5.4.0.
1862 *
1863 *
1864 *
1865 * CURLOPT_MAX_SEND_SPEED_LARGE
1866 *
1867 * If an upload exceeds this speed (counted in bytes per second) on
1868 * cumulative average during the transfer, the transfer will pause to
1869 * keep the average rate less than or equal to the parameter value.
1870 * Defaults to unlimited speed.
1871 *
1872 *
1873 * Added in cURL 7.15.5. Available since PHP 5.4.0.
1874 *
1875 *
1876 *
1877 * CURLOPT_SSH_AUTH_TYPES
1878 *
1879 * A bitmask consisting of one or more of
1880 * CURLSSH_AUTH_PUBLICKEY,
1881 * CURLSSH_AUTH_PASSWORD,
1882 * CURLSSH_AUTH_HOST,
1883 * CURLSSH_AUTH_KEYBOARD. Set to
1884 * CURLSSH_AUTH_ANY to let libcurl pick one.
1885 *
1886 *
1887 * Added in cURL 7.16.1.
1888 *
1889 *
1890 *
1891 * CURLOPT_IPRESOLVE
1892 *
1893 * Allows an application to select what kind of IP addresses to use when
1894 * resolving host names. This is only interesting when using host names that
1895 * resolve addresses using more than one version of IP, possible values are
1896 * CURL_IPRESOLVE_WHATEVER,
1897 * CURL_IPRESOLVE_V4,
1898 * CURL_IPRESOLVE_V6, by default
1899 * CURL_IPRESOLVE_WHATEVER.
1900 *
1901 *
1902 * Added in cURL 7.10.8.
1903 *
1904 *
1905 *
1906 * CURLOPT_FTP_FILEMETHOD
1907 *
1908 * Tell curl which method to use to reach a file on a FTP(S) server. Possible values are
1909 * CURLFTPMETHOD_MULTICWD,
1910 * CURLFTPMETHOD_NOCWD and
1911 * CURLFTPMETHOD_SINGLECWD.
1912 *
1913 *
1914 * Added in cURL 7.15.1. Available since PHP 5.3.0.
1915 *
1916 *
1917 *
1918 *
1919 *
1920 *
1921 * This option is deprecated, as it was never implemented in cURL and
1922 * never had any effect.
1923 *
1924 * The HTTP authentication method(s) to use. The options are:
1925 * CURLAUTH_BASIC,
1926 * CURLAUTH_DIGEST,
1927 * CURLAUTH_GSSNEGOTIATE,
1928 * CURLAUTH_NTLM,
1929 * CURLAUTH_ANY, and
1930 * CURLAUTH_ANYSAFE.
1931 *
1932 * The bitwise | (or) operator can be used to combine
1933 * more than one method. If this is done, cURL will poll the server to see
1934 * what methods it supports and pick the best one.
1935 *
1936 * CURLAUTH_ANY is an alias for
1937 * CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
1938 *
1939 * CURLAUTH_ANYSAFE is an alias for
1940 * CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM.
1941 *
1942 * Bitmask of CURLPROTO_* values. If used, this bitmask
1943 * limits what protocols libcurl may use in the transfer. This allows you to have
1944 * a libcurl built to support a wide range of protocols but still limit specific
1945 * transfers to only be allowed to use a subset of them. By default libcurl will
1946 * accept all protocols it supports.
1947 * See also CURLOPT_REDIR_PROTOCOLS.
1948 *
1949 * Valid protocol options are:
1950 * CURLPROTO_HTTP,
1951 * CURLPROTO_HTTPS,
1952 * CURLPROTO_FTP,
1953 * CURLPROTO_FTPS,
1954 * CURLPROTO_SCP,
1955 * CURLPROTO_SFTP,
1956 * CURLPROTO_TELNET,
1957 * CURLPROTO_LDAP,
1958 * CURLPROTO_LDAPS,
1959 * CURLPROTO_DICT,
1960 * CURLPROTO_FILE,
1961 * CURLPROTO_TFTP,
1962 * CURLPROTO_ALL
1963 *
1964 * The SOCKS5 authentication method(s) to use. The options are:
1965 * CURLAUTH_BASIC,
1966 * CURLAUTH_GSSAPI,
1967 * CURLAUTH_NONE.
1968 *
1969 * The bitwise | (or) operator can be used to combine
1970 * more than one method. If this is done, cURL will poll the server to see
1971 * what methods it supports and pick the best one.
1972 *
1973 * CURLAUTH_BASIC allows username/password authentication.
1974 *
1975 * CURLAUTH_GSSAPI allows GSS-API authentication.
1976 *
1977 * CURLAUTH_NONE allows no authentication.
1978 *
1979 * Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI.
1980 * Set the actual username and password with the CURLOPT_PROXYUSERPWD option.
1981 *
1982 * Your best bet is to not set this and let it use the default.
1983 * Setting it to 2 or 3 is very dangerous given the known
1984 * vulnerabilities in SSLv2 and SSLv3.
1985 *
1986 * Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT
1987 * which will attempt to figure out the remote SSL protocol version.
1988 *
1989 * value should be a string for the
1990 * following values of the option parameter:
1991 *
1992 *
1993 *
1994 *
1995 * Option
1996 * Set value to
1997 * Notes
1998 *
1999 *
2000 *
2001 *
2002 * CURLOPT_ABSTRACT_UNIX_SOCKET
2003 *
2004 * Enables the use of an abstract Unix domain socket instead of
2005 * establishing a TCP connection to a host and sets the path to
2006 * the given string. This option shares the same semantics
2007 * as CURLOPT_UNIX_SOCKET_PATH. These two options
2008 * share the same storage and therefore only one of them can be set
2009 * per handle.
2010 *
2011 *
2012 * Available since PHP 7.3.0 and cURL 7.53.0
2013 *
2014 *
2015 *
2016 * CURLOPT_CAINFO
2017 *
2018 * The name of a file holding one or more certificates to verify the
2019 * peer with. This only makes sense when used in combination with
2020 * CURLOPT_SSL_VERIFYPEER.
2021 *
2022 *
2023 * Might require an absolute path.
2024 *
2025 *
2026 *
2027 * CURLOPT_CAPATH
2028 *
2029 * A directory that holds multiple CA certificates. Use this option
2030 * alongside CURLOPT_SSL_VERIFYPEER.
2031 *
2032 *
2033 *
2034 *
2035 *
2036 * CURLOPT_COOKIE
2037 *
2038 * The contents of the "Cookie: " header to be
2039 * used in the HTTP request.
2040 * Note that multiple cookies are separated with a semicolon followed
2041 * by a space (e.g., "fruit=apple; colour=red")
2042 *
2043 *
2044 *
2045 *
2046 *
2047 * CURLOPT_COOKIEFILE
2048 *
2049 * The name of the file containing the cookie data. The cookie file can
2050 * be in Netscape format, or just plain HTTP-style headers dumped into
2051 * a file.
2052 * If the name is an empty string, no cookies are loaded, but cookie
2053 * handling is still enabled.
2054 *
2055 *
2056 *
2057 *
2058 *
2059 * CURLOPT_COOKIEJAR
2060 *
2061 * The name of a file to save all internal cookies to when the handle is closed,
2062 * e.g. after a call to curl_close.
2063 *
2064 *
2065 *
2066 *
2067 *
2068 * CURLOPT_COOKIELIST
2069 *
2070 * A cookie string (i.e. a single line in Netscape/Mozilla format, or a regular
2071 * HTTP-style Set-Cookie header) adds that single cookie to the internal cookie store.
2072 * "ALL" erases all cookies held in memory.
2073 * "SESS" erases all session cookies held in memory.
2074 * "FLUSH" writes all known cookies to the file specified by CURLOPT_COOKIEJAR.
2075 * "RELOAD" loads all cookies from the files specified by CURLOPT_COOKIEFILE.
2076 *
2077 *
2078 * Available since PHP 5.5.0 and cURL 7.14.1.
2079 *
2080 *
2081 *
2082 * CURLOPT_CUSTOMREQUEST
2083 *
2084 * A custom request method to use instead of
2085 * "GET" or "HEAD" when doing
2086 * a HTTP request. This is useful for doing
2087 * "DELETE" or other, more obscure HTTP requests.
2088 * Valid values are things like "GET",
2089 * "POST", "CONNECT" and so on;
2090 * i.e. Do not enter a whole HTTP request line here. For instance,
2091 * entering "GET /index.html HTTP/1.0\r\n\r\n"
2092 * would be incorrect.
2093 *
2094 *
2095 * Don't do this without making sure the server supports the custom
2096 * request method first.
2097 *
2098 *
2099 *
2100 *
2101 *
2102 *
2103 *
2104 * CURLOPT_DEFAULT_PROTOCOL
2105 *
2106 * The default protocol to use if the URL is missing a scheme name.
2107 *
2108 *
2109 * Added in cURL 7.45.0. Available since PHP 7.0.7.
2110 *
2111 *
2112 *
2113 * CURLOPT_DNS_INTERFACE
2114 *
2115 * Set the name of the network interface that the DNS resolver should bind to.
2116 * This must be an interface name (not an address).
2117 *
2118 *
2119 * Added in cURL 7.33.0. Available since PHP 7.0.7.
2120 *
2121 *
2122 *
2123 * CURLOPT_DNS_LOCAL_IP4
2124 *
2125 * Set the local IPv4 address that the resolver should bind to. The argument
2126 * should contain a single numerical IPv4 address as a string.
2127 *
2128 *
2129 * Added in cURL 7.33.0. Available since PHP 7.0.7.
2130 *
2131 *
2132 *
2133 * CURLOPT_DNS_LOCAL_IP6
2134 *
2135 * Set the local IPv6 address that the resolver should bind to. The argument
2136 * should contain a single numerical IPv6 address as a string.
2137 *
2138 *
2139 * Added in cURL 7.33.0. Available since PHP 7.0.7.
2140 *
2141 *
2142 *
2143 * CURLOPT_EGDSOCKET
2144 *
2145 * Like CURLOPT_RANDOM_FILE, except a filename
2146 * to an Entropy Gathering Daemon socket.
2147 *
2148 *
2149 *
2150 *
2151 *
2152 * CURLOPT_ENCODING
2153 *
2154 * The contents of the "Accept-Encoding: " header.
2155 * This enables decoding of the response. Supported encodings are
2156 * "identity", "deflate", and
2157 * "gzip". If an empty string, "",
2158 * is set, a header containing all supported encoding types is sent.
2159 *
2160 *
2161 * Added in cURL 7.10.
2162 *
2163 *
2164 *
2165 * CURLOPT_FTPPORT
2166 *
2167 * The value which will be used to get the IP address to use
2168 * for the FTP "PORT" instruction. The "PORT" instruction tells
2169 * the remote server to connect to our specified IP address. The
2170 * string may be a plain IP address, a hostname, a network
2171 * interface name (under Unix), or just a plain '-' to use the
2172 * systems default IP address.
2173 *
2174 *
2175 *
2176 *
2177 *
2178 * CURLOPT_INTERFACE
2179 *
2180 * The name of the outgoing network interface to use. This can be an
2181 * interface name, an IP address or a host name.
2182 *
2183 *
2184 *
2185 *
2186 *
2187 * CURLOPT_KEYPASSWD
2188 *
2189 * The password required to use the CURLOPT_SSLKEY
2190 * or CURLOPT_SSH_PRIVATE_KEYFILE private key.
2191 *
2192 *
2193 * Added in cURL 7.16.1.
2194 *
2195 *
2196 *
2197 * CURLOPT_KRB4LEVEL
2198 *
2199 * The KRB4 (Kerberos 4) security level. Any of the following values
2200 * (in order from least to most powerful) are valid:
2201 * "clear",
2202 * "safe",
2203 * "confidential",
2204 * "private"..
2205 * If the string does not match one of these,
2206 * "private" is used. Setting this option to NULL
2207 * will disable KRB4 security. Currently KRB4 security only works
2208 * with FTP transactions.
2209 *
2210 *
2211 *
2212 *
2213 *
2214 * CURLOPT_LOGIN_OPTIONS
2215 *
2216 * Can be used to set protocol specific login options, such as the
2217 * preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
2218 * and should be used in conjunction with the
2219 * CURLOPT_USERNAME option.
2220 *
2221 *
2222 * Added in cURL 7.34.0. Available since PHP 7.0.7.
2223 *
2224 *
2225 *
2226 * CURLOPT_PINNEDPUBLICKEY
2227 *
2228 * Set the pinned public key.
2229 * The string can be the file name of your pinned public key. The file
2230 * format expected is "PEM" or "DER". The string can also be any
2231 * number of base64 encoded sha256 hashes preceded by "sha256//" and
2232 * separated by ";".
2233 *
2234 *
2235 * Added in cURL 7.39.0. Available since PHP 7.0.7.
2236 *
2237 *
2238 *
2239 * CURLOPT_POSTFIELDS
2240 *
2241 *
2242 * The full data to post in a HTTP "POST" operation.
2243 * To post a file, prepend a filename with @ and
2244 * use the full path. The filetype can be explicitly specified by
2245 * following the filename with the type in the format
2246 * ';type=mimetype'. This parameter can either be
2247 * passed as a urlencoded string like 'para1=val1&amp;para2=val2&amp;...'
2248 * or as an array with the field name as key and field data as value.
2249 * If value is an array, the
2250 * Content-Type header will be set to
2251 * multipart/form-data.
2252 *
2253 *
2254 * As of PHP 5.2.0, value must be an array if
2255 * files are passed to this option with the @ prefix.
2256 *
2257 *
2258 * As of PHP 5.5.0, the @ prefix is deprecated and
2259 * files can be sent using CURLFile. The
2260 * @ prefix can be disabled for safe passing of
2261 * values beginning with @ by setting the
2262 * CURLOPT_SAFE_UPLOAD option to TRUE.
2263 *
2264 *
2265 *
2266 *
2267 *
2268 *
2269 * CURLOPT_PRIVATE
2270 *
2271 * Any data that should be associated with this cURL handle. This data
2272 * can subsequently be retrieved with the
2273 * CURLINFO_PRIVATE option of
2274 * curl_getinfo. cURL does nothing with this data.
2275 * When using a cURL multi handle, this private data is typically a
2276 * unique key to identify a standard cURL handle.
2277 *
2278 *
2279 * Added in cURL 7.10.3.
2280 *
2281 *
2282 *
2283 * CURLOPT_PRE_PROXY
2284 *
2285 * Set a string holding the host name or dotted numerical
2286 * IP address to be used as the preproxy that curl connects to before
2287 * it connects to the HTTP(S) proxy specified in the
2288 * CURLOPT_PROXY option for the upcoming request.
2289 * The preproxy can only be a SOCKS proxy and it should be prefixed with
2290 * [scheme]:// to specify which kind of socks is used.
2291 * A numerical IPv6 address must be written within [brackets].
2292 * Setting the preproxy to an empty string explicitly disables the use of a preproxy.
2293 * To specify port number in this string, append :[port]
2294 * to the end of the host name. The proxy's port number may optionally be
2295 * specified with the separate option CURLOPT_PROXYPORT.
2296 * Defaults to using port 1080 for proxies if a port is not specified.
2297 *
2298 *
2299 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2300 *
2301 *
2302 *
2303 * CURLOPT_PROXY
2304 *
2305 * The HTTP proxy to tunnel requests through.
2306 *
2307 *
2308 *
2309 *
2310 *
2311 * CURLOPT_PROXY_SERVICE_NAME
2312 *
2313 * The proxy authentication service name.
2314 *
2315 *
2316 * Added in cURL 7.34.0. Available since PHP 7.0.7.
2317 *
2318 *
2319 *
2320 * CURLOPT_PROXY_CAINFO
2321 *
2322 * The path to proxy Certificate Authority (CA) bundle. Set the path as a
2323 * string naming a file holding one or more certificates to
2324 * verify the HTTPS proxy with.
2325 * This option is for connecting to an HTTPS proxy, not an HTTPS server.
2326 * Defaults set to the system path where libcurl's cacert bundle is assumed
2327 * to be stored.
2328 *
2329 *
2330 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2331 *
2332 *
2333 *
2334 * CURLOPT_PROXY_CAPATH
2335 *
2336 * The directory holding multiple CA certificates to verify the HTTPS proxy with.
2337 *
2338 *
2339 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2340 *
2341 *
2342 *
2343 * CURLOPT_PROXY_CRLFILE
2344 *
2345 * Set the file name with the concatenation of CRL (Certificate Revocation List)
2346 * in PEM format to use in the certificate validation that occurs during
2347 * the SSL exchange.
2348 *
2349 *
2350 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2351 *
2352 *
2353 *
2354 * CURLOPT_PROXY_KEYPASSWD
2355 *
2356 * Set the string be used as the password required to use the
2357 * CURLOPT_PROXY_SSLKEY private key. You never needed a
2358 * passphrase to load a certificate but you need one to load your private key.
2359 * This option is for connecting to an HTTPS proxy, not an HTTPS server.
2360 *
2361 *
2362 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2363 *
2364 *
2365 *
2366 * CURLOPT_PROXY_PINNEDPUBLICKEY
2367 *
2368 * Set the pinned public key for HTTPS proxy. The string can be the file name
2369 * of your pinned public key. The file format expected is "PEM" or "DER".
2370 * The string can also be any number of base64 encoded sha256 hashes preceded by
2371 * "sha256//" and separated by ";"
2372 *
2373 *
2374 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2375 *
2376 *
2377 *
2378 * CURLOPT_PROXY_SSLCERT
2379 *
2380 * The file name of your client certificate used to connect to the HTTPS proxy.
2381 * The default format is "P12" on Secure Transport and "PEM" on other engines,
2382 * and can be changed with CURLOPT_PROXY_SSLCERTTYPE.
2383 * With NSS or Secure Transport, this can also be the nickname of the certificate
2384 * you wish to authenticate with as it is named in the security database.
2385 * If you want to use a file from the current directory, please precede it with
2386 * "./" prefix, in order to avoid confusion with a nickname.
2387 *
2388 *
2389 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2390 *
2391 *
2392 *
2393 * CURLOPT_PROXY_SSLCERTTYPE
2394 *
2395 * The format of your client certificate used when connecting to an HTTPS proxy.
2396 * Supported formats are "PEM" and "DER", except with Secure Transport.
2397 * OpenSSL (versions 0.9.3 and later) and Secure Transport
2398 * (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for
2399 * PKCS#12-encoded files. Defaults to "PEM".
2400 *
2401 *
2402 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2403 *
2404 *
2405 *
2406 * CURLOPT_PROXY_SSL_CIPHER_LIST
2407 *
2408 * The list of ciphers to use for the connection to the HTTPS proxy.
2409 * The list must be syntactically correct, it consists of one or more cipher
2410 * strings separated by colons. Commas or spaces are also acceptable separators
2411 * but colons are normally used, !, - and + can be used as operators.
2412 *
2413 *
2414 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2415 *
2416 *
2417 *
2418 * CURLOPT_PROXY_TLS13_CIPHERS
2419 *
2420 * The list of cipher suites to use for the TLS 1.3 connection to a proxy.
2421 * The list must be syntactically correct, it consists of one or more
2422 * cipher suite strings separated by colons. This option is currently used
2423 * only when curl is built to use OpenSSL 1.1.1 or later.
2424 * If you are using a different SSL backend you can try setting
2425 * TLS 1.3 cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST option.
2426 *
2427 *
2428 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.61.0. Available when built with OpenSSL &gt;= 1.1.1.
2429 *
2430 *
2431 *
2432 * CURLOPT_PROXY_SSLKEY
2433 *
2434 * The file name of your private key used for connecting to the HTTPS proxy.
2435 * The default format is "PEM" and can be changed with
2436 * CURLOPT_PROXY_SSLKEYTYPE.
2437 * (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport.
2438 *
2439 *
2440 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0. Available if built TLS enabled.
2441 *
2442 *
2443 *
2444 * CURLOPT_PROXY_SSLKEYTYPE
2445 *
2446 * The format of your private key. Supported formats are "PEM", "DER" and "ENG".
2447 *
2448 *
2449 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2450 *
2451 *
2452 *
2453 * CURLOPT_PROXY_TLSAUTH_PASSWORD
2454 *
2455 * The password to use for the TLS authentication method specified with the
2456 * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
2457 * CURLOPT_PROXY_TLSAUTH_USERNAME option to also be set.
2458 *
2459 *
2460 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2461 *
2462 *
2463 *
2464 * CURLOPT_PROXY_TLSAUTH_TYPE
2465 *
2466 * The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP".
2467 *
2468 *
2469 * Secure Remote Password (SRP) authentication for TLS provides mutual authentication
2470 * if both sides have a shared secret. To use TLS-SRP, you must also set the
2471 * CURLOPT_PROXY_TLSAUTH_USERNAME and
2472 * CURLOPT_PROXY_TLSAUTH_PASSWORD options.
2473 *
2474 *
2475 *
2476 *
2477 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2478 *
2479 *
2480 *
2481 * CURLOPT_PROXY_TLSAUTH_USERNAME
2482 *
2483 * Tusername to use for the HTTPS proxy TLS authentication method specified with the
2484 * CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the
2485 * CURLOPT_PROXY_TLSAUTH_PASSWORD option to also be set.
2486 *
2487 *
2488 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.52.0.
2489 *
2490 *
2491 *
2492 * CURLOPT_PROXYUSERPWD
2493 *
2494 * A username and password formatted as
2495 * "[username]:[password]" to use for the
2496 * connection to the proxy.
2497 *
2498 *
2499 *
2500 *
2501 *
2502 * CURLOPT_RANDOM_FILE
2503 *
2504 * A filename to be used to seed the random number generator for SSL.
2505 *
2506 *
2507 *
2508 *
2509 *
2510 * CURLOPT_RANGE
2511 *
2512 * Range(s) of data to retrieve in the format
2513 * "X-Y" where X or Y are optional. HTTP transfers
2514 * also support several intervals, separated with commas in the format
2515 * "X-Y,N-M".
2516 *
2517 *
2518 *
2519 *
2520 *
2521 * CURLOPT_REFERER
2522 *
2523 * The contents of the "Referer: " header to be used
2524 * in a HTTP request.
2525 *
2526 *
2527 *
2528 *
2529 *
2530 * CURLOPT_SERVICE_NAME
2531 *
2532 * The authentication service name.
2533 *
2534 *
2535 * Added in cURL 7.43.0. Available since PHP 7.0.7.
2536 *
2537 *
2538 *
2539 * CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
2540 *
2541 * A string containing 32 hexadecimal digits. The string should be the
2542 * MD5 checksum of the remote host's public key, and libcurl will reject
2543 * the connection to the host unless the md5sums match.
2544 * This option is only for SCP and SFTP transfers.
2545 *
2546 *
2547 * Added in cURL 7.17.1.
2548 *
2549 *
2550 *
2551 * CURLOPT_SSH_PUBLIC_KEYFILE
2552 *
2553 * The file name for your public key. If not used, libcurl defaults to
2554 * $HOME/.ssh/id_dsa.pub if the HOME environment variable is set,
2555 * and just "id_dsa.pub" in the current directory if HOME is not set.
2556 *
2557 *
2558 * Added in cURL 7.16.1.
2559 *
2560 *
2561 *
2562 * CURLOPT_SSH_PRIVATE_KEYFILE
2563 *
2564 * The file name for your private key. If not used, libcurl defaults to
2565 * $HOME/.ssh/id_dsa if the HOME environment variable is set,
2566 * and just "id_dsa" in the current directory if HOME is not set.
2567 * If the file is password-protected, set the password with
2568 * CURLOPT_KEYPASSWD.
2569 *
2570 *
2571 * Added in cURL 7.16.1.
2572 *
2573 *
2574 *
2575 * CURLOPT_SSL_CIPHER_LIST
2576 *
2577 * A list of ciphers to use for SSL. For example,
2578 * RC4-SHA and TLSv1 are valid
2579 * cipher lists.
2580 *
2581 *
2582 *
2583 *
2584 *
2585 * CURLOPT_SSLCERT
2586 *
2587 * The name of a file containing a PEM formatted certificate.
2588 *
2589 *
2590 *
2591 *
2592 *
2593 * CURLOPT_SSLCERTPASSWD
2594 *
2595 * The password required to use the
2596 * CURLOPT_SSLCERT certificate.
2597 *
2598 *
2599 *
2600 *
2601 *
2602 * CURLOPT_SSLCERTTYPE
2603 *
2604 * The format of the certificate. Supported formats are
2605 * "PEM" (default), "DER",
2606 * and "ENG".
2607 * As of OpenSSL 0.9.3, "P12" (for PKCS#12-encoded files)
2608 * is also supported.
2609 *
2610 *
2611 * Added in cURL 7.9.3.
2612 *
2613 *
2614 *
2615 * CURLOPT_SSLENGINE
2616 *
2617 * The identifier for the crypto engine of the private SSL key
2618 * specified in CURLOPT_SSLKEY.
2619 *
2620 *
2621 *
2622 *
2623 *
2624 * CURLOPT_SSLENGINE_DEFAULT
2625 *
2626 * The identifier for the crypto engine used for asymmetric crypto
2627 * operations.
2628 *
2629 *
2630 *
2631 *
2632 *
2633 * CURLOPT_SSLKEY
2634 *
2635 * The name of a file containing a private SSL key.
2636 *
2637 *
2638 *
2639 *
2640 *
2641 * CURLOPT_SSLKEYPASSWD
2642 *
2643 * The secret password needed to use the private SSL key specified in
2644 * CURLOPT_SSLKEY.
2645 *
2646 *
2647 * Since this option contains a sensitive password, remember to keep
2648 * the PHP script it is contained within safe.
2649 *
2650 *
2651 *
2652 *
2653 *
2654 *
2655 *
2656 * CURLOPT_SSLKEYTYPE
2657 *
2658 * The key type of the private SSL key specified in
2659 * CURLOPT_SSLKEY. Supported key types are
2660 * "PEM" (default), "DER",
2661 * and "ENG".
2662 *
2663 *
2664 *
2665 *
2666 *
2667 * CURLOPT_TLS13_CIPHERS
2668 *
2669 * The list of cipher suites to use for the TLS 1.3 connection. The list must be
2670 * syntactically correct, it consists of one or more cipher suite strings separated by colons.
2671 * This option is currently used only when curl is built to use OpenSSL 1.1.1 or later.
2672 * If you are using a different SSL backend you can try setting
2673 * TLS 1.3 cipher suites by using the CURLOPT_SSL_CIPHER_LIST option.
2674 *
2675 *
2676 * Available since PHP 7.3.0 and libcurl &gt;= cURL 7.61.0. Available when built with OpenSSL &gt;= 1.1.1.
2677 *
2678 *
2679 *
2680 * CURLOPT_UNIX_SOCKET_PATH
2681 *
2682 * Enables the use of Unix domain sockets as connection endpoint and
2683 * sets the path to the given string.
2684 *
2685 *
2686 * Added in cURL 7.40.0. Available since PHP 7.0.7.
2687 *
2688 *
2689 *
2690 * CURLOPT_URL
2691 *
2692 * The URL to fetch. This can also be set when initializing a
2693 * session with curl_init.
2694 *
2695 *
2696 *
2697 *
2698 *
2699 * CURLOPT_USERAGENT
2700 *
2701 * The contents of the "User-Agent: " header to be
2702 * used in a HTTP request.
2703 *
2704 *
2705 *
2706 *
2707 *
2708 * CURLOPT_USERNAME
2709 *
2710 * The user name to use in authentication.
2711 *
2712 *
2713 * Added in cURL 7.19.1. Available since PHP 5.5.0.
2714 *
2715 *
2716 *
2717 * CURLOPT_USERPWD
2718 *
2719 * A username and password formatted as
2720 * "[username]:[password]" to use for the
2721 * connection.
2722 *
2723 *
2724 *
2725 *
2726 *
2727 * CURLOPT_XOAUTH2_BEARER
2728 *
2729 * Specifies the OAuth 2.0 access token.
2730 *
2731 *
2732 * Added in cURL 7.33.0. Available since PHP 7.0.7.
2733 *
2734 *
2735 *
2736 *
2737 *
2738 *
2739 * A custom request method to use instead of
2740 * "GET" or "HEAD" when doing
2741 * a HTTP request. This is useful for doing
2742 * "DELETE" or other, more obscure HTTP requests.
2743 * Valid values are things like "GET",
2744 * "POST", "CONNECT" and so on;
2745 * i.e. Do not enter a whole HTTP request line here. For instance,
2746 * entering "GET /index.html HTTP/1.0\r\n\r\n"
2747 * would be incorrect.
2748 *
2749 *
2750 * Don't do this without making sure the server supports the custom
2751 * request method first.
2752 *
2753 *
2754 *
2755 * Don't do this without making sure the server supports the custom
2756 * request method first.
2757 *
2758 * The default protocol to use if the URL is missing a scheme name.
2759 *
2760 * Set the name of the network interface that the DNS resolver should bind to.
2761 * This must be an interface name (not an address).
2762 *
2763 * Set the local IPv4 address that the resolver should bind to. The argument
2764 * should contain a single numerical IPv4 address as a string.
2765 *
2766 * Set the local IPv6 address that the resolver should bind to. The argument
2767 * should contain a single numerical IPv6 address as a string.
2768 *
2769 * Secure Remote Password (SRP) authentication for TLS provides mutual authentication
2770 * if both sides have a shared secret. To use TLS-SRP, you must also set the
2771 * CURLOPT_PROXY_TLSAUTH_USERNAME and
2772 * CURLOPT_PROXY_TLSAUTH_PASSWORD options.
2773 *
2774 * The secret password needed to use the private SSL key specified in
2775 * CURLOPT_SSLKEY.
2776 *
2777 *
2778 * Since this option contains a sensitive password, remember to keep
2779 * the PHP script it is contained within safe.
2780 *
2781 *
2782 *
2783 * Since this option contains a sensitive password, remember to keep
2784 * the PHP script it is contained within safe.
2785 *
2786 * value should be an array for the
2787 * following values of the option parameter:
2788 *
2789 *
2790 *
2791 *
2792 * Option
2793 * Set value to
2794 * Notes
2795 *
2796 *
2797 *
2798 *
2799 * CURLOPT_CONNECT_TO
2800 *
2801 * Connect to a specific host and port instead of the URL's host and port.
2802 * Accepts an array of strings with the format
2803 * HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT.
2804 *
2805 *
2806 * Added in cURL 7.49.0. Available since PHP 7.0.7.
2807 *
2808 *
2809 *
2810 * CURLOPT_HTTP200ALIASES
2811 *
2812 * An array of HTTP 200 responses that will be treated as valid
2813 * responses and not as errors.
2814 *
2815 *
2816 * Added in cURL 7.10.3.
2817 *
2818 *
2819 *
2820 * CURLOPT_HTTPHEADER
2821 *
2822 * An array of HTTP header fields to set, in the format
2823 *
2824 * array('Content-type: text/plain', 'Content-length: 100')
2825 *
2826 *
2827 *
2828 *
2829 *
2830 *
2831 * CURLOPT_POSTQUOTE
2832 *
2833 * An array of FTP commands to execute on the server after the FTP
2834 * request has been performed.
2835 *
2836 *
2837 *
2838 *
2839 *
2840 * CURLOPT_PROXYHEADER
2841 *
2842 * An array of custom HTTP headers to pass to proxies.
2843 *
2844 *
2845 * Added in cURL 7.37.0. Available since PHP 7.0.7.
2846 *
2847 *
2848 *
2849 * CURLOPT_QUOTE
2850 *
2851 * An array of FTP commands to execute on the server prior to the FTP
2852 * request.
2853 *
2854 *
2855 *
2856 *
2857 *
2858 * CURLOPT_RESOLVE
2859 *
2860 * Provide a custom address for a specific host and port pair. An array
2861 * of hostname, port, and IP address strings, each element separated by
2862 * a colon. In the format:
2863 *
2864 * array("example.com:80:127.0.0.1")
2865 *
2866 *
2867 *
2868 * Added in cURL 7.21.3. Available since PHP 5.5.0.
2869 *
2870 *
2871 *
2872 *
2873 *
2874 *
2875 * value should be a stream resource (using
2876 * fopen, for example) for the following values of the
2877 * option parameter:
2878 *
2879 *
2880 *
2881 *
2882 * Option
2883 * Set value to
2884 *
2885 *
2886 *
2887 *
2888 * CURLOPT_FILE
2889 *
2890 * The file that the transfer should be written to. The default
2891 * is STDOUT (the browser window).
2892 *
2893 *
2894 *
2895 * CURLOPT_INFILE
2896 *
2897 * The file that the transfer should be read from when uploading.
2898 *
2899 *
2900 *
2901 * CURLOPT_STDERR
2902 *
2903 * An alternative location to output errors to instead of
2904 * STDERR.
2905 *
2906 *
2907 *
2908 * CURLOPT_WRITEHEADER
2909 *
2910 * The file that the header part of the transfer is written to.
2911 *
2912 *
2913 *
2914 *
2915 *
2916 *
2917 * value should be the name of a valid function or a Closure
2918 * for the following values of the option parameter:
2919 *
2920 *
2921 *
2922 *
2923 * Option
2924 * Set value to
2925 *
2926 *
2927 *
2928 *
2929 * CURLOPT_HEADERFUNCTION
2930 *
2931 * A callback accepting two parameters.
2932 * The first is the cURL resource, the second is a
2933 * string with the header data to be written. The header data must
2934 * be written by this callback. Return the number of
2935 * bytes written.
2936 *
2937 *
2938 *
2939 * CURLOPT_PASSWDFUNCTION
2940 *
2941 * A callback accepting three parameters.
2942 * The first is the cURL resource, the second is a
2943 * string containing a password prompt, and the third is the maximum
2944 * password length. Return the string containing the password.
2945 *
2946 *
2947 *
2948 * CURLOPT_PROGRESSFUNCTION
2949 *
2950 *
2951 * A callback accepting five parameters.
2952 * The first is the cURL resource, the second is the total number of
2953 * bytes expected to be downloaded in this transfer, the third is
2954 * the number of bytes downloaded so far, the fourth is the total
2955 * number of bytes expected to be uploaded in this transfer, and the
2956 * fifth is the number of bytes uploaded so far.
2957 *
2958 *
2959 *
2960 * The callback is only called when the CURLOPT_NOPROGRESS
2961 * option is set to FALSE.
2962 *
2963 *
2964 *
2965 * Return a non-zero value to abort the transfer. In which case, the
2966 * transfer will set a CURLE_ABORTED_BY_CALLBACK
2967 * error.
2968 *
2969 *
2970 *
2971 *
2972 * CURLOPT_READFUNCTION
2973 *
2974 * A callback accepting three parameters.
2975 * The first is the cURL resource, the second is a
2976 * stream resource provided to cURL through the option
2977 * CURLOPT_INFILE, and the third is the maximum
2978 * amount of data to be read. The callback must return a string
2979 * with a length equal or smaller than the amount of data requested,
2980 * typically by reading it from the passed stream resource. It should
2981 * return an empty string to signal EOF.
2982 *
2983 *
2984 *
2985 * CURLOPT_WRITEFUNCTION
2986 *
2987 * A callback accepting two parameters.
2988 * The first is the cURL resource, and the second is a
2989 * string with the data to be written. The data must be saved by
2990 * this callback. It must return the exact number of bytes written
2991 * or the transfer will be aborted with an error.
2992 *
2993 *
2994 *
2995 *
2996 *
2997 *
2998 * A callback accepting five parameters.
2999 * The first is the cURL resource, the second is the total number of
3000 * bytes expected to be downloaded in this transfer, the third is
3001 * the number of bytes downloaded so far, the fourth is the total
3002 * number of bytes expected to be uploaded in this transfer, and the
3003 * fifth is the number of bytes uploaded so far.
3004 *
3005 * The callback is only called when the CURLOPT_NOPROGRESS
3006 * option is set to FALSE.
3007 *
3008 * Return a non-zero value to abort the transfer. In which case, the
3009 * transfer will set a CURLE_ABORTED_BY_CALLBACK
3010 * error.
3011 *
3012 * Other values:
3013 *
3014 *
3015 *
3016 *
3017 * Option
3018 * Set value to
3019 *
3020 *
3021 *
3022 *
3023 * CURLOPT_SHARE
3024 *
3025 * A result of curl_share_init. Makes the cURL
3026 * handle to use the data from the shared handle.
3027 *
3028 *
3029 *
3030 *
3031 *
3032 * @throws CurlException
3033 *
3034 */
3035 function curl_setopt($ch, int $option, $value): void
3036 {
3037 error_clear_last();
3038 $result = \curl_setopt($ch, $option, $value);
3039 if ($result === false) {
3040 throw CurlException::createFromCurlResource($ch);
3041 }
3042 }
3043
3044
3045 /**
3046 * Return an integer containing the last share curl error number.
3047 *
3048 * @param resource $sh A cURL share handle returned by curl_share_init.
3049 * @return int Returns an integer containing the last share curl error number.
3050 * @throws CurlException
3051 *
3052 */
3053 function curl_share_errno($sh): int
3054 {
3055 error_clear_last();
3056 $result = \curl_share_errno($sh);
3057 if ($result === false) {
3058 throw CurlException::createFromPhpError();
3059 }
3060 return $result;
3061 }
3062
3063
3064 /**
3065 * Sets an option on the given cURL share handle.
3066 *
3067 * @param resource $sh A cURL share handle returned by curl_share_init.
3068 * @param int $option
3069 *
3070 *
3071 *
3072 * Option
3073 * Description
3074 *
3075 *
3076 *
3077 *
3078 * CURLSHOPT_SHARE
3079 *
3080 * Specifies a type of data that should be shared.
3081 *
3082 *
3083 *
3084 * CURLSHOPT_UNSHARE
3085 *
3086 * Specifies a type of data that will be no longer shared.
3087 *
3088 *
3089 *
3090 *
3091 *
3092 * @param string $value
3093 *
3094 *
3095 *
3096 * Value
3097 * Description
3098 *
3099 *
3100 *
3101 *
3102 * CURL_LOCK_DATA_COOKIE
3103 *
3104 * Shares cookie data.
3105 *
3106 *
3107 *
3108 * CURL_LOCK_DATA_DNS
3109 *
3110 * Shares DNS cache. Note that when you use cURL multi handles,
3111 * all handles added to the same multi handle will share DNS cache
3112 * by default.
3113 *
3114 *
3115 *
3116 * CURL_LOCK_DATA_SSL_SESSION
3117 *
3118 * Shares SSL session IDs, reducing the time spent on the SSL
3119 * handshake when reconnecting to the same server. Note that SSL
3120 * session IDs are reused within the same handle by default.
3121 *
3122 *
3123 *
3124 *
3125 *
3126 * @throws CurlException
3127 *
3128 */
3129 function curl_share_setopt($sh, int $option, string $value): void
3130 {
3131 error_clear_last();
3132 $result = \curl_share_setopt($sh, $option, $value);
3133 if ($result === false) {
3134 throw CurlException::createFromPhpError();
3135 }
3136 }
3137
3138
3139 /**
3140 * This function decodes the given URL encoded string.
3141 *
3142 * @param resource $ch A cURL handle returned by
3143 * curl_init.
3144 * @param string $str The URL encoded string to be decoded.
3145 * @return string Returns decoded string.
3146 * @throws CurlException
3147 *
3148 */
3149 function curl_unescape($ch, string $str): string
3150 {
3151 error_clear_last();
3152 $result = \curl_unescape($ch, $str);
3153 if ($result === false) {
3154 throw CurlException::createFromCurlResource($ch);
3155 }
3156 return $result;
3157 }
3158