From 8fcdccdcdccf6e6fe43995fd08a30731aada9f4e Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 8 Jun 2012 13:48:38 -0400 Subject: Add Amazon Web Services SDK to 3rdparty for Amazon S3 external storage --- 3rdparty/aws-sdk/utilities/batchrequest.class.php | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 3rdparty/aws-sdk/utilities/batchrequest.class.php (limited to '3rdparty/aws-sdk/utilities/batchrequest.class.php') diff --git a/3rdparty/aws-sdk/utilities/batchrequest.class.php b/3rdparty/aws-sdk/utilities/batchrequest.class.php new file mode 100644 index 00000000000..978283471a4 --- /dev/null +++ b/3rdparty/aws-sdk/utilities/batchrequest.class.php @@ -0,0 +1,126 @@ +queue = array(); + $this->limit = $limit ? $limit : -1; + $this->credentials = new CFCredential(array()); + return $this; + } + + /** + * Sets the AWS credentials to use for the batch request. + * + * @param CFCredential $credentials (Required) The credentials to use for signing and making requests. + * @return $this A reference to the current instance. + */ + public function use_credentials(CFCredential $credentials) + { + $this->credentials = $credentials; + return $this; + } + + /** + * Adds a new cURL handle to the request queue. + * + * @param resource $handle (Required) A cURL resource to add to the queue. + * @return $this A reference to the current instance. + */ + public function add($handle) + { + $this->queue[] = $handle; + return $this; + } + + /** + * Executes the batch request queue. + * + * @param array $opt (DO NOT USE) Enabled for compatibility with the method this overrides, although any values passed will be ignored. + * @return array An indexed array of objects. + */ + public function send($opt = null) + { + $http = new $this->request_class(null, $this->proxy, null, $this->credentials); + + // Make the request + $response = $http->send_multi_request($this->queue, array( + 'limit' => $this->limit + )); + + return $response; + } +} -- cgit v1.2.3