@@ -66,14 +66,14 @@ public function get($url, $data = array())
66
66
$ this ->setOpt (CURLOPT_URL , $ url );
67
67
}
68
68
$ this ->setOpt (CURLOPT_HTTPGET , true );
69
- $ this ->_exec ();
69
+ $ this ->exec ();
70
70
}
71
71
72
72
public function post ($ url , $ data = array ())
73
73
{
74
74
$ this ->setOpt (CURLOPT_URL , $ url );
75
75
$ this ->preparePayload ($ data );
76
- $ this ->_exec ();
76
+ $ this ->exec ();
77
77
}
78
78
79
79
public function put ($ url , $ data = array (), $ payload = false )
@@ -86,7 +86,7 @@ public function put($url, $data = array(), $payload = false)
86
86
87
87
$ this ->setOpt (CURLOPT_URL , $ url );
88
88
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'PUT ' );
89
- $ this ->_exec ();
89
+ $ this ->exec ();
90
90
}
91
91
92
92
public function patch ($ url , $ data = array (), $ payload = false )
@@ -99,7 +99,7 @@ public function patch($url, $data = array(), $payload = false)
99
99
100
100
$ this ->setOpt (CURLOPT_URL , $ url );
101
101
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'PATCH ' );
102
- $ this ->_exec ();
102
+ $ this ->exec ();
103
103
}
104
104
105
105
public function delete ($ url , $ data = array (), $ payload = false )
@@ -111,7 +111,7 @@ public function delete($url, $data = array(), $payload = false)
111
111
}
112
112
$ this ->setOpt (CURLOPT_URL , $ url );
113
113
$ this ->setOpt (CURLOPT_CUSTOMREQUEST , 'DELETE ' );
114
- $ this ->_exec ();
114
+ $ this ->exec ();
115
115
}
116
116
117
117
public function setBasicAuthentication ($ username , $ password )
@@ -184,7 +184,15 @@ public function reset()
184
184
$ this ->init ();
185
185
}
186
186
187
+ /**
188
+ * @deprecated calling exec() directly is discouraged
189
+ */
187
190
public function _exec ()
191
+ {
192
+ return $ this ->exec ();
193
+ }
194
+
195
+ protected function exec ()
188
196
{
189
197
$ this ->response = curl_exec ($ this ->curl );
190
198
$ this ->curl_error_code = curl_errno ($ this ->curl );
0 commit comments