Skip to content

Commit 8883d52

Browse files
committed
fix parameters of Curl constructor
1 parent 4c544ee commit 8883d52

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $options = [//The custom options of cURL
3131
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
3232
];
3333

34-
$c = new Curl($options);
34+
$c = new Curl(null, $options);
3535
$c->makeGet($getUrl);
3636
$response = $c->exec();
3737
if ($response->hasError()) {
@@ -114,7 +114,7 @@ $options = [//The custom options of cURL
114114
CURLOPT_CONNECTTIMEOUT => 5,
115115
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
116116
];
117-
$c = new Curl($options);
117+
$c = new Curl(null, $options);
118118
$file1 = new CURLFile('./olddriver.gif', 'image/gif', 'name1');
119119
$params = ['file1' => $file1];
120120
$c->makePost($postUrl, $params);
@@ -138,7 +138,7 @@ $options = [//The custom options of cURL
138138
CURLOPT_CONNECTTIMEOUT => 10,
139139
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
140140
];
141-
$c = new Curl($options);
141+
$c = new Curl(null, $options);
142142
$c->makeGet($fileUrl);
143143
$response = $c->exec();
144144
if ($response->hasError()) {

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818
],
1919
"require": {
20-
"php": ">=5.4"
20+
"php": ">=5.4",
21+
"ext-curl": "*"
2122
},
2223
"autoload": {
2324
"psr-4": {

examples/downloadfile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
require '../vendor/autoload.php';
3+
34
use Hhxsv5\PhpMultiCurl\Curl;
45

56
$fileUrl = 'https://avatars2.githubusercontent.com/u/7278743?s=460&v=4';//<?php var_dump($_FILES);
@@ -8,7 +9,7 @@
89
CURLOPT_CONNECTTIMEOUT => 10,
910
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
1011
];
11-
$c = new Curl($options);
12+
$c = new Curl(null, $options);
1213
$c->makeGet($fileUrl);
1314
$response = $c->exec();
1415
if ($response->hasError()) {

examples/example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
1515
];
1616

17-
$c = new Curl($options);
17+
$c = new Curl(null, $options);
1818
$c->makeGet($getUrl);
1919
$response = $c->exec();
2020
if ($response->hasError()) {

examples/uploadfile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
CURLOPT_CONNECTTIMEOUT => 5,
1111
CURLOPT_USERAGENT => 'Multi-cURL client v1.5.0',
1212
];
13-
$c = new Curl($options);
13+
$c = new Curl(null, $options);
1414

1515
$file1 = new CURLFile('./olddriver.gif', 'image/gif', 'name1');
1616
$params = ['file1' => $file1];

0 commit comments

Comments
 (0)