Commit Graph

104 Commits

Author SHA1 Message Date
Zach Borboa af08135139 Fix flaky rate limit tests caused by inconsistent sleep times 2021-03-14 00:07:54 -05:00
Philipp Keck 933e0bb76b Fix close() under PHP8
Fixes #662

At least on some platforms, maybe always with PHP8, is_resource(curl_init())===false because it returns the new \CurlHandle type instead.
2021-03-13 18:23:09 -05:00
Zach Borboa eac149a259 Clean up 2021-03-13 17:37:47 -05:00
Zach Borboa 3d8e4c38c2 Allow passing an indexed array to MultiCurl::setHeaders() 2020-10-31 14:59:35 -07:00
Zach Borboa cea618a6c1 Update docblock with possible exceptions thrown 2020-10-30 21:32:43 -07:00
Zach Borboa cec296410a Clean up 2020-05-17 18:53:13 -07:00
Zach Borboa 976008d094 Implement rate limiting requests via MultiCurl::setRateLimit() 2020-05-16 22:01:15 -07:00
Zach Borboa ab407d6b25 Implement disableTimeout()
Implement Curl::disableTimeout() and MultiCurl::disableTimeout()
2020-05-09 09:19:35 -07:00
Zach Borboa 85c9a1a5e9 Clean up 2020-04-10 19:31:28 -07:00
harry 09006e0e26 Implement setInterface()
Implement Curl::setInterface() and MultiCurl::setInterface()
2020-04-10 12:02:41 +05:30
Zach Borboa cf9ab59780 Use setFile() 2020-01-14 21:01:04 -08:00
Zach Borboa 15a6a4dd98 Use setRange() 2020-01-14 20:58:42 -08:00
Zach Borboa a020585a73 Fix #608: Implement Curl::setRange() and MultiCurl::setRange() 2020-01-14 20:55:41 -08:00
Zach Borboa 1d0f6cfc84 Fix #609: Implement Curl::setFile() and MultiCurl::setFile() 2020-01-14 20:36:19 -08:00
Zach Borboa 2d591c3b7c Fix lingering temporary download file when using MultiCurl::addDownload() (#602) 2019-11-17 00:19:57 -08:00
Zach Borboa 7b70bc2697 Fix #602: Unify download implementation of MultiCurl::addDownload with Curl::download 2019-10-14 00:08:41 -07:00
Zach Borboa 505663a55d Use camelCase for ArrayUtil function names and deprecate old snake_case names 2019-06-09 22:26:18 -07:00
Zach Borboa 9a538f3a6b Reduce number of ops 2019-05-12 21:13:10 -07:00
Zach Borboa 0857023319 Fix #572,#582: Add MultiCurl::setProxies() to make multicurl requests with multiple proxies 2019-05-12 01:01:57 -07:00
Zach Borboa 8e5a0a29c3 Correct implementation of MultiCurl::setProxyAuth() 2019-05-11 23:04:55 -07:00
Zach Borboa 6f76666ee5 Clarify documentation for Curl::setRetry() and MultiCurl::setRetry() 2019-05-03 00:35:30 -07:00
Zach Borboa 35a32a7a77 Fix #567: Add proxy support for MultiCurl 2019-01-05 00:43:21 -08:00
Zach Borboa cdad9e1a01 Rename variable to use isChildOfMultiCurl as method name 2018-07-07 03:59:46 -07:00
Zach Borboa e240b43606 Fix #511: Use correct body in POST requests that use empty data arrays.
This fixes JSON POST requests incorrectly sending a serialized empty
array "[]" instead of an empty request body by default.
2018-04-26 02:49:21 -07:00
Zach Borboa a028011f3d Fix #506: Remove content-length header for PATCH requests when data is empty 2018-04-09 01:03:40 -07:00
Zach Borboa 83cd9d14ee Update comment to match new behavior 2018-03-06 22:17:38 -08:00
agapov97 caf1ec2062 multicurl - starting new requests while curls array is not empty and activeCurls array size less than concurrency 2018-02-26 17:21:21 +03:00
Zach Borboa 40f7026185 Fix #493: Build POST data correctly when headers have been set.
Call MultiCurl::queueHandle sooner so that headers are correctly set when Curl::buildPostData is called and builds POST data differently depending on the request content-type.
2018-01-26 00:58:37 -08:00
Zach Borboa 44c1539ba6 Fix decoders set on individual instances ignored 2018-01-25 22:49:57 -08:00
Zach Borboa 21729d22a9 Use Curl::setCookies in favor Curl::setCookie in loop 2018-01-25 21:20:11 -08:00
Zach Borboa 50927dd294 Rename callbacks 2018-01-25 20:29:55 -08:00
Zach Borboa aa74a1cea4 Clean up 2018-01-25 19:52:20 -08:00
Zach Borboa 4ec89be9bc Allow setRetry() methods to use callables 2017-09-02 02:23:40 -07:00
Zach Borboa 0f1e16a6fa Implement MultiCurl::setRetry() 2017-08-31 01:26:42 -07:00
Zach Borboa 2264362338 Clean up namespacing 2017-04-30 15:58:33 -07:00
Zach Borboa d21a7dcc8b Clean up completed multi curl instance to fix memory leak 2017-04-30 03:10:24 -07:00
Zach Borboa efbcc080bb Allow the disabling of automatic response decoding.
The following will disable their respective decoders:

  $curl->setDefaultDecoder(false);
  $curl->setJsonDecoder(false);
  $curl->setXmlDecoder(false);
2017-04-29 02:54:35 -07:00
Zach Borboa 5aed969628 Add additional wait when curl_multi_select fails to block 2017-04-27 00:15:48 -07:00
Zach Borboa 79f659d159 Fix probable bugs; Clean up style 2016-12-28 19:19:23 -08:00
Zach Borboa 7dc6eba0af Process multicurl requests in ascending numerical order.
Previously, multicurl requests were added to the end and removed from the end. Requests are now added to the end and
removed from the beginning. Using array_shift() will be slower than array_pop().

Before using "array_push()" + array_pop():
  1
  1 2
  1 2 3
  1 2 3 4
  1 2 3
  1 2
  1

After using "array_push()" + array_shift():
  1
  1 2
  1 2 3
  1 2 3 4
  2 3 4
  3 4
  4
2016-12-25 01:45:16 -05:00
Zach Borboa 7b5dd71bd5 Implement MultiCurl::setCookies() 2016-12-23 00:20:51 -08:00
Zach Borboa de1869b3ee Return boolean when calling setCookieFile() and setCookieJar() 2016-12-15 03:53:47 -08:00
Zach Borboa 5cb8223c47 Fix #400: Use sequential ids to allow for ordered post processing 2016-10-14 19:50:57 -07:00
Zach Borboa 97b24c65fa Return curl instance when calling MultiCurl::addCurl() like other MultiCurl::add*() methods 2016-10-12 08:24:45 -07:00
Kai Hempel e087f51c61 Add a curl add method for direct handle attach 2016-10-11 17:13:32 +02:00
Zach Borboa ecdfa174cb Rename setURL to setUrl 2016-09-27 00:24:22 -07:00
Zach Borboa bfc868fab4 Remove foreach loops 2016-09-24 01:22:44 -07:00
Zach Borboa 36ad0e4ecf Implement setHeaders() 2016-09-24 01:15:27 -07:00
Zach Borboa 90b17385f6 Implement removeHeader(); unsetHeader now unsets existing header
removeHeader() removes an internal request header.
unsetHeader() now removes an extra header previously set using setHeader().
2016-09-24 00:09:55 -07:00
Zach Borboa f4fffbc486 Add ability to set the number of concurrent requests 2016-09-04 20:54:57 -07:00