Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -2025,13 +2025,15 @@ final class S3Request
* @param string $endpoint AWS endpoint URI
* @return mixed
*/
function __construct($verb, $bucket = '', $uri = '', $endpoint = 's3.amazonaws.com')
function __construct($verb, $bucket = '', $uri = '', $endpoint = 's3.amazonaws.com', $connTimeout = 30, $execTimeout = 30)
{

$this->endpoint = $endpoint;
$this->verb = $verb;
$this->bucket = $bucket;
$this->uri = $uri !== '' ? '/'.str_replace('%2F', '/', rawurlencode($uri)) : '/';
$this->connTimeout = $connTimeout;
$this->execTimeout = $execTimeout;

//if ($this->bucket !== '')
// $this->resource = '/'.$this->bucket.$this->uri;
Expand Down Expand Up @@ -2164,6 +2166,10 @@ public function getResponse()
curl_setopt($curl, CURLOPT_PROXYUSERPWD, sprintf('%s:%s', S3::$proxy['user'], S3::$proxy['pass']));
}

// Timeouts
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->connTimeout);
curl_setopt($curl, CURLOPT_TIMEOUT, $this->execTimeout);

// Headers
$headers = array(); $amz = array();
foreach ($this->amzHeaders as $header => $value)
Expand Down