1 | <?php namespace Phabricator\Client\Curl; |
||
14 | class CurlRequest { |
||
15 | |||
16 | /** |
||
17 | * @var string The url to the request be made |
||
18 | */ |
||
19 | private $requestUrl; |
||
20 | |||
21 | /** |
||
22 | * @var Resource CURL resource |
||
23 | */ |
||
24 | private $handler; |
||
25 | |||
26 | /** |
||
27 | * Constructor |
||
28 | * |
||
29 | * @param string $requestUrl |
||
30 | */ |
||
31 | 6 | public function __construct($requestUrl) { |
|
36 | |||
37 | /** |
||
38 | * Initialize the CURL session |
||
39 | */ |
||
40 | 6 | public function initialize() { |
|
47 | |||
48 | /** |
||
49 | * Set an opt in current curl handler |
||
50 | * |
||
51 | * @param int $option |
||
52 | * @param mixed $value |
||
53 | * |
||
54 | * @throws \BuildR\Foundation\Exception\RuntimeException |
||
55 | * |
||
56 | * @return \Phabricator\Client\Curl\CurlRequest |
||
57 | */ |
||
58 | 6 | public function setOption($option, $value) { |
|
68 | |||
69 | /** |
||
70 | * Set multiple options with an associative array |
||
71 | * |
||
72 | * @param $options |
||
73 | * |
||
74 | * @return \Phabricator\Client\Curl\CurlRequest |
||
75 | */ |
||
76 | 1 | public function setOptionFromArray($options) { |
|
83 | |||
84 | /** |
||
85 | * Set the posted data. And also set the CURLOPT_POST option to TRUE, if is |
||
86 | * not set already. |
||
87 | * |
||
88 | * @param array $postData |
||
89 | * |
||
90 | * @codeCoverageIgnore |
||
91 | */ |
||
92 | public function setPostData(array $postData) { |
||
96 | |||
97 | /** |
||
98 | * Close the current request |
||
99 | */ |
||
100 | 1 | public function close() { |
|
103 | |||
104 | /** |
||
105 | * Execute the prepared request and optionally returns the response |
||
106 | * |
||
107 | * @param bool $returnTransfer Returns the returned response |
||
108 | * |
||
109 | * @throws \BuildR\Foundation\Exception\RuntimeException |
||
110 | * |
||
111 | * @return array|\stdClass |
||
112 | * |
||
113 | * @codeCoverageIgnore |
||
114 | */ |
||
115 | public function execute($returnTransfer = TRUE) { |
||
132 | |||
133 | } |
||
134 |