Closed ESmith92 closed 8 years ago
also should we add a timeout for the curl (var seconds = 120; curl_setopt($ch, CURLOPT_TIMEOUT, seconds );)
No need. PHP's garbage collection will call the destructor for you. Unless, of course, our implementation causes PHP to hold on to the reference to an instance of HttpGet
.
As for the timeout, that's something that could be a new issue. I haven't considered it, but I should have! By default, CURLOPT_TIMEOUT
is set to 0 (indefinite). It'll be worth setting a default timeout.
one more thing: we should add a get function for curl info (return curl_getinfo( $curl );) so we can throw exceptions
Created new issue for timeout and error handling.
just wondering why the __destruct() function was left out of the execute. Is there a case where we would need that curl object still after we get the response?