PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.0.1
Defender Security – Malware Scanner, Login Security & Firewall v3.0.1
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 / vendor / thecodingmachine / safe / generated / curl.php

curl.php in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at vendor/thecodingmachine/safe/generated/curl.php

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