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; } }