@@ -33,11 +33,11 @@ class Curl
33
33
public $ response = null ;
34
34
public $ rawResponse = null ;
35
35
36
- public $ beforeSendFunction = null ;
37
- public $ downloadCompleteFunction = null ;
38
- public $ successFunction = null ;
39
- public $ errorFunction = null ;
40
- public $ completeFunction = null ;
36
+ public $ beforeSendCallback = null ;
37
+ public $ downloadCompleteCallback = null ;
38
+ public $ successCallback = null ;
39
+ public $ errorCallback = null ;
40
+ public $ completeCallback = null ;
41
41
public $ fileHandle = null ;
42
42
43
43
public $ attempts = 0 ;
@@ -136,7 +136,7 @@ public function __construct($base_url = null)
136
136
*/
137
137
public function beforeSend ($ callback )
138
138
{
139
- $ this ->beforeSendFunction = $ callback ;
139
+ $ this ->beforeSendCallback = $ callback ;
140
140
}
141
141
142
142
/**
@@ -230,7 +230,7 @@ public function close()
230
230
*/
231
231
public function complete ($ callback )
232
232
{
233
- $ this ->completeFunction = $ callback ;
233
+ $ this ->completeCallback = $ callback ;
234
234
}
235
235
236
236
/**
@@ -281,7 +281,7 @@ public function delete($url, $query_parameters = array(), $data = array())
281
281
public function download ($ url , $ mixed_filename )
282
282
{
283
283
if (is_callable ($ mixed_filename )) {
284
- $ this ->downloadCompleteFunction = $ mixed_filename ;
284
+ $ this ->downloadCompleteCallback = $ mixed_filename ;
285
285
$ this ->fileHandle = tmpfile ();
286
286
} else {
287
287
$ filename = $ mixed_filename ;
@@ -303,7 +303,7 @@ public function download($url, $mixed_filename)
303
303
$ this ->fileHandle = fopen ($ download_filename , $ mode );
304
304
305
305
// Move the downloaded temporary file to the destination save path.
306
- $ this ->downloadCompleteFunction = function ($ instance , $ fh ) use ($ download_filename , $ filename ) {
306
+ $ this ->downloadCompleteCallback = function ($ instance , $ fh ) use ($ download_filename , $ filename ) {
307
307
// Close the open file handle before renaming the file.
308
308
if (is_resource ($ fh )) {
309
309
fclose ($ fh );
@@ -327,7 +327,7 @@ public function download($url, $mixed_filename)
327
327
*/
328
328
public function error ($ callback )
329
329
{
330
- $ this ->errorFunction = $ callback ;
330
+ $ this ->errorCallback = $ callback ;
331
331
}
332
332
333
333
/**
@@ -344,7 +344,7 @@ public function exec($ch = null)
344
344
345
345
if ($ ch === null ) {
346
346
$ this ->responseCookies = array ();
347
- $ this ->call ($ this ->beforeSendFunction );
347
+ $ this ->call ($ this ->beforeSendCallback );
348
348
$ this ->rawResponse = curl_exec ($ this ->curl );
349
349
$ this ->curlErrorCode = curl_errno ($ this ->curl );
350
350
$ this ->curlErrorMessage = curl_error ($ this ->curl );
@@ -416,12 +416,12 @@ public function exec($ch = null)
416
416
public function execDone ()
417
417
{
418
418
if ($ this ->error ) {
419
- $ this ->call ($ this ->errorFunction );
419
+ $ this ->call ($ this ->errorCallback );
420
420
} else {
421
- $ this ->call ($ this ->successFunction );
421
+ $ this ->call ($ this ->successCallback );
422
422
}
423
423
424
- $ this ->call ($ this ->completeFunction );
424
+ $ this ->call ($ this ->completeCallback );
425
425
426
426
// Close open file handles and reset the curl instance.
427
427
if (!($ this ->fileHandle === null )) {
@@ -1145,7 +1145,7 @@ public function attemptRetry()
1145
1145
*/
1146
1146
public function success ($ callback )
1147
1147
{
1148
- $ this ->successFunction = $ callback ;
1148
+ $ this ->successCallback = $ callback ;
1149
1149
}
1150
1150
1151
1151
/**
@@ -1321,10 +1321,10 @@ private function createHeaderCallback($header_callback_data)
1321
1321
*/
1322
1322
private function downloadComplete ($ fh )
1323
1323
{
1324
- if (!$ this ->error && $ this ->downloadCompleteFunction ) {
1324
+ if (!$ this ->error && $ this ->downloadCompleteCallback ) {
1325
1325
rewind ($ fh );
1326
- $ this ->call ($ this ->downloadCompleteFunction , $ fh );
1327
- $ this ->downloadCompleteFunction = null ;
1326
+ $ this ->call ($ this ->downloadCompleteCallback , $ fh );
1327
+ $ this ->downloadCompleteCallback = null ;
1328
1328
}
1329
1329
1330
1330
if (is_resource ($ fh )) {
0 commit comments