1 | <?php |
||
5 | class CurlClient |
||
6 | { |
||
7 | /** |
||
8 | * cURL handle. |
||
9 | * |
||
10 | * @var resource |
||
11 | */ |
||
12 | protected $handle = null; |
||
13 | |||
14 | /** |
||
15 | * Assign dependencies. |
||
16 | */ |
||
17 | 10 | public function __construct() |
|
21 | |||
22 | /** |
||
23 | * Set an option on the resource handle. |
||
24 | * |
||
25 | * @param int $name |
||
26 | * @param mixed $value |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | 8 | public function setOption($name, $value) |
|
34 | |||
35 | /** |
||
36 | * Get info about the current cURL resource. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | 2 | public function getInfo() |
|
44 | |||
45 | /** |
||
46 | * Execute the request. |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | 6 | public function execute() |
|
54 | |||
55 | /** |
||
56 | * Get error from the cURL call. |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | 4 | public function error() |
|
64 | |||
65 | /** |
||
66 | * Close the cURL session. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | 4 | public function close() |
|
74 | } |
||
75 |