/
curl.php
3277 lines (3252 loc) · 70.5 KB
/
curl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
namespace Safe;
use Safe\Exceptions\CurlException;
/**
* Copies a cURL handle keeping the same preferences.
*
* @param \CurlHandle $handle A cURL handle returned by
* curl_init.
* @return \CurlHandle Returns a new cURL handle.
* @throws CurlException
*
*/
function curl_copy_handle(\CurlHandle $handle): \CurlHandle
{
error_clear_last();
$result = \curl_copy_handle($handle);
if ($result === false) {
throw CurlException::createFromPhpError($handle);
}
return $result;
}
/**
* This function URL encodes the given string according to RFC 3986.
*
* @param \CurlHandle $handle A cURL handle returned by
* curl_init.
* @param string $string The string to be encoded.
* @return string Returns escaped string.
* @throws CurlException
*
*/
function curl_escape(\CurlHandle $handle, string $string): string
{
error_clear_last();
$result = \curl_escape($handle, $string);
if ($result === false) {
throw CurlException::createFromPhpError($handle);
}
return $result;
}
/**
* Execute the given cURL session.
*
* This function should be called after initializing a cURL session and all
* the options for the session are set.
*
* @param \CurlHandle $handle A cURL handle returned by
* curl_init.
* @return bool|string Returns TRUE on success. However, if the CURLOPT_RETURNTRANSFER
* option is set, it will return
* the result on success, FALSE on failure.
* @throws CurlException
*
*/
function curl_exec(\CurlHandle $handle)
{
error_clear_last();
$result = \curl_exec($handle);
if ($result === false) {
throw CurlException::createFromPhpError($handle);
}
return $result;
}
/**
* Gets information about the last transfer.
*
* @param \CurlHandle $handle A cURL handle returned by
* curl_init.
* @param int $option This may be one of the following constants:
*
*
*
* CURLINFO_EFFECTIVE_URL - Last effective URL
*
*
*
*
* CURLINFO_HTTP_CODE - The last response code.
* As of cURL 7.10.8, this is a legacy alias of
* CURLINFO_RESPONSE_CODE
*
*
*
*
* CURLINFO_FILETIME - Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown
*
*
*
*
* CURLINFO_TOTAL_TIME - Total transaction time in seconds for last transfer
*
*
*
*
* CURLINFO_NAMELOOKUP_TIME - Time in seconds until name resolving was complete
*
*
*
*
* CURLINFO_CONNECT_TIME - Time in seconds it took to establish the connection
*
*
*
*
* CURLINFO_PRETRANSFER_TIME - Time in seconds from start until just before file transfer begins
*
*
*
*
* CURLINFO_STARTTRANSFER_TIME - Time in seconds until the first byte is about to be transferred
*
*
*
*
* CURLINFO_REDIRECT_COUNT - Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled
*
*
*
*
* CURLINFO_REDIRECT_TIME - Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled
*
*
*
*
* 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
*
*
*
*
* CURLINFO_PRIMARY_IP - IP address of the most recent connection
*
*
*
*
* CURLINFO_PRIMARY_PORT - Destination port of the most recent connection
*
*
*
*
* CURLINFO_LOCAL_IP - Local (source) IP address of the most recent connection
*
*
*
*
* CURLINFO_LOCAL_PORT - Local (source) port of the most recent connection
*
*
*
*
* CURLINFO_SIZE_UPLOAD - Total number of bytes uploaded
*
*
*
*
* CURLINFO_SIZE_DOWNLOAD - Total number of bytes downloaded
*
*
*
*
* CURLINFO_SPEED_DOWNLOAD - Average download speed
*
*
*
*
* CURLINFO_SPEED_UPLOAD - Average upload speed
*
*
*
*
* CURLINFO_HEADER_SIZE - Total size of all headers received
*
*
*
*
* CURLINFO_HEADER_OUT - The request string sent. For this to
* work, add the CURLINFO_HEADER_OUT option to the handle by calling
* curl_setopt
*
*
*
*
* CURLINFO_REQUEST_SIZE - Total size of issued requests, currently only for HTTP requests
*
*
*
*
* CURLINFO_SSL_VERIFYRESULT - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER
*
*
*
*
* CURLINFO_CONTENT_LENGTH_DOWNLOAD - Content length of download, read from Content-Length: field
*
*
*
*
* CURLINFO_CONTENT_LENGTH_UPLOAD - Specified size of upload
*
*
*
*
* CURLINFO_CONTENT_TYPE - Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header
*
*
*
*
* CURLINFO_PRIVATE - Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt
*
*
*
*
* CURLINFO_RESPONSE_CODE - The last response code
*
*
*
*
* CURLINFO_HTTP_CONNECTCODE - The CONNECT response code
*
*
*
*
* CURLINFO_HTTPAUTH_AVAIL - Bitmask indicating the authentication method(s) available according to the previous response
*
*
*
*
* CURLINFO_PROXYAUTH_AVAIL - Bitmask indicating the proxy authentication method(s) available according to the previous response
*
*
*
*
* CURLINFO_OS_ERRNO - Errno from a connect failure. The number is OS and system specific.
*
*
*
*
* CURLINFO_NUM_CONNECTS - Number of connections curl had to create to achieve the previous transfer
*
*
*
*
* CURLINFO_SSL_ENGINES - OpenSSL crypto-engines supported
*
*
*
*
* CURLINFO_COOKIELIST - All known cookies
*
*
*
*
* CURLINFO_FTP_ENTRY_PATH - Entry path in FTP server
*
*
*
*
* CURLINFO_APPCONNECT_TIME - Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed
*
*
*
*
* CURLINFO_CERTINFO - TLS certificate chain
*
*
*
*
* CURLINFO_CONDITION_UNMET - Info on unmet time conditional
*
*
*
*
* CURLINFO_RTSP_CLIENT_CSEQ - Next RTSP client CSeq
*
*
*
*
* CURLINFO_RTSP_CSEQ_RECV - Recently received CSeq
*
*
*
*
* CURLINFO_RTSP_SERVER_CSEQ - Next RTSP server CSeq
*
*
*
*
* CURLINFO_RTSP_SESSION_ID - RTSP session ID
*
*
*
*
* 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
*
*
*
*
* CURLINFO_CONTENT_LENGTH_UPLOAD_T - The specified size of the upload. -1 if the size isn't known
*
*
*
*
* 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
*
*
*
*
* CURLINFO_PROTOCOL - The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values
*
*
*
*
* 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
*
*
*
*
* CURLINFO_SCHEME - The URL scheme used for the most recent connection
*
*
*
*
* 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
*
*
*
*
* CURLINFO_SIZE_UPLOAD_T - Total number of bytes that were uploaded
*
*
*
*
* CURLINFO_SPEED_DOWNLOAD_T - The average download speed in bytes/second that curl measured for the complete download
*
*
*
*
* CURLINFO_SPEED_UPLOAD_T - The average upload speed in bytes/second that curl measured for the complete upload
*
*
*
*
* CURLINFO_APPCONNECT_TIME_T - Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed
*
*
*
*
* CURLINFO_CONNECT_TIME_T - Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed
*
*
*
*
* 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
*
*
*
*
* CURLINFO_NAMELOOKUP_TIME_T - Time in microseconds from the start until the name resolving was completed
*
*
*
*
* CURLINFO_PRETRANSFER_TIME_T - Time taken from the start until the file transfer is just about to begin, in microseconds
*
*
*
*
* 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
*
*
*
*
* CURLINFO_STARTTRANSFER_TIME_T - Time, in microseconds, it took from the start until the first byte is received
*
*
*
*
* CURLINFO_TOTAL_TIME_T - Total time in microseconds for the previous transfer, including name resolving, TCP connect etc.
*
*
*
* @return mixed If option is given, returns its value.
* Otherwise, returns an associative array with the following elements
* (which correspond to option):
*
*
*
* "url"
*
*
*
*
* "content_type"
*
*
*
*
* "http_code"
*
*
*
*
* "header_size"
*
*
*
*
* "request_size"
*
*
*
*
* "filetime"
*
*
*
*
* "ssl_verify_result"
*
*
*
*
* "redirect_count"
*
*
*
*
* "total_time"
*
*
*
*
* "namelookup_time"
*
*
*
*
* "connect_time"
*
*
*
*
* "pretransfer_time"
*
*
*
*
* "size_upload"
*
*
*
*
* "size_download"
*
*
*
*
* "speed_download"
*
*
*
*
* "speed_upload"
*
*
*
*
* "download_content_length"
*
*
*
*
* "upload_content_length"
*
*
*
*
* "starttransfer_time"
*
*
*
*
* "redirect_time"
*
*
*
*
* "certinfo"
*
*
*
*
* "primary_ip"
*
*
*
*
* "primary_port"
*
*
*
*
* "local_ip"
*
*
*
*
* "local_port"
*
*
*
*
* "redirect_url"
*
*
*
*
* "request_header" (This is only set if the CURLINFO_HEADER_OUT
* is set by a previous call to curl_setopt)
*
*
*
* Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option.
* @throws CurlException
*
*/
function curl_getinfo(\CurlHandle $handle, int $option = null)
{
error_clear_last();
if ($option !== null) {
$result = \curl_getinfo($handle, $option);
} else {
$result = \curl_getinfo($handle);
}
if ($result === false) {
throw CurlException::createFromPhpError($handle);
}
return $result;
}
/**
* Initializes a new session and return a cURL handle for use with the
* curl_setopt, curl_exec,
* and curl_close functions.
*
* @param string $url If provided, the CURLOPT_URL option will be set
* to its value. You can manually set this using the
* curl_setopt function.
*
* The file protocol is disabled by cURL if
* open_basedir is set.
* @return \CurlHandle Returns a cURL handle on success, FALSE on errors.
* @throws CurlException
*
*/
function curl_init(string $url = null): \CurlHandle
{
error_clear_last();
if ($url !== null) {
$result = \curl_init($url);
} else {
$result = \curl_init();
}
if ($result === false) {
throw CurlException::createFromPhpError();
}
return $result;
}
/**
* Ask the multi handle if there are any messages or information from the individual transfers.
* Messages may include information such as an error code from the transfer or just the fact
* that a transfer is completed.
*
* Repeated calls to this function will return a new result each time, until a FALSE is returned
* as a signal that there is no more to get at this point. The integer pointed to with
* queued_messages will contain the number of remaining messages after this
* function was called.
*
* @param \CurlMultiHandle $multi_handle A cURL multi handle returned by
* curl_multi_init.
* @param int|null $queued_messages Number of messages that are still in the queue
* @return array On success, returns an associative array for the message, FALSE on failure.
*
*
* Contents of the returned array
*
*
*
* Key:
* Value:
*
*
*
*
* msg
* The CURLMSG_DONE constant. Other return values
* are currently not available.
*
*
* result
* One of the CURLE_* constants. If everything is
* OK, the CURLE_OK will be the result.
*
*
* handle
* Resource of type curl indicates the handle which it concerns.
*
*
*
*
* @throws CurlException
*
*/
function curl_multi_info_read(\CurlMultiHandle $multi_handle, ?int &$queued_messages = null): array
{
error_clear_last();
$result = \curl_multi_info_read($multi_handle, $queued_messages);
if ($result === false) {
throw CurlException::createFromPhpError($multi_handle);
}
return $result;
}
/**
* Allows the processing of multiple cURL handles asynchronously.
*
* @return \CurlMultiHandle Returns a cURL multi handle on success, FALSE on failure.
* @throws CurlException
*
*/
function curl_multi_init(): \CurlMultiHandle
{
error_clear_last();
$result = \curl_multi_init();
if ($result === false) {
throw CurlException::createFromPhpError();
}
return $result;
}
/**
*
*
* @param \CurlMultiHandle $multi_handle
* @param int $option One of the CURLMOPT_* constants.
* @param mixed $value The value to be set on option.
*
* value should be an int for the
* following values of the option parameter:
*
*
*
*
* Option
* Set value to
*
*
*
*
* CURLMOPT_PIPELINING
*
* Pass 1 to enable or 0 to disable. Enabling pipelining on a multi
* handle will make it attempt to perform HTTP Pipelining as far as
* possible for transfers using this handle. This means that if you add
* a second request that can use an already existing connection, the
* second request will be "piped" on the same connection.
* As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new
* transfer over an existing HTTP/2 connection if possible.
* Passing 3 instructs cURL to ask for pipelining and multiplexing
* independently of each other.
* As of cURL 7.62.0, setting the pipelining bit has no effect.
* Instead of integer literals, you can also use the CURLPIPE_*
* constants if available.
*
*
*
* CURLMOPT_MAXCONNECTS
*
* Pass a number that will be used as the maximum amount of
* simultaneously open connections that libcurl may cache.
* By default the size will be enlarged to fit four times the number
* of handles added via curl_multi_add_handle.
* When the cache is full, curl closes the oldest one in the cache
* to prevent the number of open connections from increasing.
*
*
*
* CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE
*
* Pass a number that specifies the chunk length threshold for pipelining
* in bytes.
*
*
*
* CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE
*
* Pass a number that specifies the size threshold for pipelining
* penalty in bytes.
*
*
*
* CURLMOPT_MAX_HOST_CONNECTIONS
*
* Pass a number that specifies the maximum number of connections to a
* single host.
*
*
*
* CURLMOPT_MAX_PIPELINE_LENGTH
*
* Pass a number that specifies the maximum number of requests in a
* pipeline.
*
*
*
* CURLMOPT_MAX_TOTAL_CONNECTIONS
*
* Pass a number that specifies the maximum number of simultaneously
* open connections.
*
*
*
* CURLMOPT_PUSHFUNCTION
*
* Pass a callable that will be registered to handle server
* pushes and should have the following signature:
*
* intpushfunction
* resourceparent_ch
* resourcepushed_ch
* arrayheaders
*
*
*
* parent_ch
*
*
* The parent cURL handle (the request the client made).
*
*
*
*
* pushed_ch
*
*
* A new cURL handle for the pushed request.
*
*
*
*
* headers
*
*
* The push promise headers.
*
*
*
*
* The push function is supposed to return either
* CURL_PUSH_OK if it can handle the push, or
* CURL_PUSH_DENY to reject it.
*
*
*
*
*
*
* The parent cURL handle (the request the client made).
*
* A new cURL handle for the pushed request.
*
* The push promise headers.
* @throws CurlException
*
*/
function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): void
{
error_clear_last();
$result = \curl_multi_setopt($multi_handle, $option, $value);
if ($result === false) {
throw CurlException::createFromPhpError($multi_handle);
}
}
/**
* Sets an option on the given cURL session handle.
*
* @param \CurlHandle $handle A cURL handle returned by
* curl_init.
* @param int $option The CURLOPT_XXX option to set.
* @param mixed $value The value to be set on option.
*
* value should be a bool for the
* following values of the option parameter:
*
*
*
*
* Option
* Set value to
* Notes
*
*
*
*
* CURLOPT_AUTOREFERER
*
* TRUE to automatically set the Referer: field in
* requests where it follows a Location: redirect.
*
*
*
*
*
* CURLOPT_COOKIESESSION
*
* TRUE to mark this as a new cookie "session". It will force libcurl
* to ignore all cookies it is about to load that are "session cookies"
* from the previous session. By default, libcurl always stores and
* loads all cookies, independent if they are session cookies or not.
* Session cookies are cookies without expiry date and they are meant
* to be alive and existing for this "session" only.
*
*
*
*
*
* CURLOPT_CERTINFO
*
* TRUE to output SSL certification information to STDERR
* on secure transfers.
*
*
* Added in cURL 7.19.1.
* Requires CURLOPT_VERBOSE to be on to have an effect.
*
*
*
* CURLOPT_CONNECT_ONLY
*
* TRUE tells the library to perform all the required proxy authentication
* and connection setup, but no data transfer. This option is implemented for
* HTTP, SMTP and POP3.
*
*
* Added in 7.15.2.
*
*
*
* CURLOPT_CRLF
*
* TRUE to convert Unix newlines to CRLF newlines
* on transfers.
*
*
*
*
*
* CURLOPT_DISALLOW_USERNAME_IN_URL
*
* TRUE to not allow URLs that include a username. Usernames are allowed by default (0).
*
*
* Added in cURL 7.61.0. Available since PHP 7.3.0.
*
*
*
* CURLOPT_DNS_SHUFFLE_ADDRESSES
*
* TRUE to shuffle the order of all returned addresses so that they will be used
* in a random order, when a name is resolved and more than one IP address is returned.
* This may cause IPv4 to be used before IPv6 or vice versa.
*
*
* Added in cURL 7.60.0. Available since PHP 7.3.0.
*
*
*
* CURLOPT_HAPROXYPROTOCOL
*
* TRUE to send an HAProxy PROXY protocol v1 header at the start of the connection.
* The default action is not to send this header.
*
*
* Added in cURL 7.60.0. Available since PHP 7.3.0.
*
*
*
* CURLOPT_SSH_COMPRESSION
*
* TRUE to enable built-in SSH compression. This is a request, not an order;
* the server may or may not do it.
*
*
* Added in cURL 7.56.0. Available since PHP 7.3.0.
*
*
*
* CURLOPT_DNS_USE_GLOBAL_CACHE
*
* TRUE to use a global DNS cache. This option is not thread-safe.
* It is conditionally enabled by default if PHP is built for non-threaded use
* (CLI, FCGI, Apache2-Prefork, etc.).
*
*
*
*
*
* CURLOPT_FAILONERROR
*
* TRUE to fail verbosely if the HTTP code returned
* is greater than or equal to 400. The default behavior is to return
* the page normally, ignoring the code.
*
*
*
*
*
* CURLOPT_SSL_FALSESTART
*
* TRUE to enable TLS false start.
*
*
* Added in cURL 7.42.0. Available since PHP 7.0.7.
*
*
*
* CURLOPT_FILETIME
*
* TRUE to attempt to retrieve the modification
* date of the remote document. This value can be retrieved using
* the CURLINFO_FILETIME option with
* curl_getinfo.
*
*
*
*
*
* CURLOPT_FOLLOWLOCATION
*
* TRUE to follow any
* "Location: " header that the server sends as
* part of the HTTP header.
* See also CURLOPT_MAXREDIRS.
*
*
*
*
*
* CURLOPT_FORBID_REUSE
*
* TRUE to force the connection to explicitly
* close when it has finished processing, and not be pooled for reuse.
*
*
*
*
*
* CURLOPT_FRESH_CONNECT
*
* TRUE to force the use of a new connection
* instead of a cached one.
*
*
*
*
*
* CURLOPT_FTP_USE_EPRT
*
* TRUE to use EPRT (and LPRT) when doing active
* FTP downloads. Use FALSE to disable EPRT and LPRT and use PORT
* only.
*
*
*
*
*
* CURLOPT_FTP_USE_EPSV
*
* TRUE to first try an EPSV command for FTP
* transfers before reverting back to PASV. Set to FALSE
* to disable EPSV.
*
*
*
*