1 | <?php |
||
32 | class Curl |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * @see https://php.net/curl_init |
||
37 | * @param string $url |
||
38 | * @return resource cURL handle |
||
39 | */ |
||
40 | public function init($url = null) |
||
41 | { |
||
42 | return curl_init($url); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @see https://php.net/curl_setopt_array |
||
47 | * @param resource $ch |
||
48 | * @param array $options |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function setoptArray($ch, array $options) |
||
52 | { |
||
53 | return curl_setopt_array($ch, $options); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @see https://php.net/curl_exec |
||
58 | * @param resource $ch |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function exec($ch) |
||
62 | { |
||
63 | return curl_exec($ch); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @see https://php.net/curl_close |
||
68 | * @param resource $ch |
||
69 | */ |
||
70 | public function close($ch) |
||
71 | { |
||
72 | curl_close($ch); |
||
73 | } |
||
74 | } |
||
75 |