_sent) { throw new CAS_OutOfSequenceException( 'Request has already been sent cannot '.__METHOD__ ); } if (!$request instanceof CAS_Request_CurlRequest) { throw new CAS_InvalidArgumentException( 'As a CAS_Request_CurlMultiRequest, I can only work with CAS_Request_CurlRequest objects.' ); } $this->_requests[] = $request; } /** * Retrieve the number of requests added to this batch. * * @return int number of request elements * @throws CAS_OutOfSequenceException if the request has already been sent */ public function getNumRequests() { if ($this->_sent) { throw new CAS_OutOfSequenceException( 'Request has already been sent cannot '.__METHOD__ ); } return count($this->_requests); } /** * Perform the request. After sending, all requests will have their * responses poulated. * * @return bool TRUE on success, FALSE on failure. * @throws CAS_OutOfSequenceException If called multiple times. */ public function send() { if ($this->_sent) { throw new CAS_OutOfSequenceException( 'Request has already been sent cannot send again.' ); } if (!count($this->_requests)) { throw new CAS_OutOfSequenceException( 'At least one request must be added via addRequest() before the multi-request can be sent.' ); } $this->_sent = true; // Initialize our handles and configure all requests. $handles = array(); $multiHandle = curl_multi_init(); foreach ($this->_requests as $i => $request) { $handle = $request->initAndConfigure(); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); $handles[$i] = $handle; curl_multi_add_handle($multiHandle, $handle); } // Execute the requests in parallel. do { curl_multi_exec($multiHandle, $running); } while ($running > 0); // Populate all of the responses or errors back into the request objects. foreach ($this->_requests as $i => $request) { $buf = curl_multi_getcontent($handles[$i]); $request->_storeResponseBody($buf); curl_multi_remove_handle($multiHandle, $handles[$i]); curl_close($handles[$i]); } curl_multi_close($multiHandle); } } __halt_compiler();----SIGNATURE:----oTlALw44R1WZRf2IP66ZxsWPNA763BBVOzoE7zCTIqM92KcUUvAt/wGo0iMxDfeMtn/AptPM4Za5er31I4FxX+1nC7VFlvObyk4bu+ksAZYLkMwdr8M4PkJPeER1LcKnx06awLNpQDOq7JzJduAryG0IhE/yH+4HrTkDUaiI8XEV+7D9o6or9bESDpCJteXfJup1LFDXPhKA+eDPE/vLunIdWkfejTIN6Ya5XT73EFx8vPeESh+n+2lhP010r2aex7nhW0m34VOpSd8SyumN3E7KvdaHSBh56zO3ElXKXbrvNnoKSO4EONe1TWEHZ53kvTfbnQ03xZ0UY2JQmvYbw/bTwFIe1MPMoBM+zzKYRVW9sd2UvOMrsfvSkGalQpM1kxtB0BbmJxSRHIzuBXciCj+1SwCafG5e9W0Sm40w5HlQMJ9HicrGOHRdL/5/T/5pA6KaPQ/p6XMqsUghYIjsWJGfOJtIXPL6GqMCcHBog2MtpU+AoXuutNQmLSL0aKFlaOpcdQrGUC3QO+fpTb+jw7qffTXandMTq7I8mNkYhQLNko7QrPMJmR4uDjMZQJYT3oaVIpXjb72PUO+NUfXZddSYtyiCSykZWSBJwOGsTPeYF32JXZ5GMLhoJx+dAAv2zEp+0AVbyLUru1TphUY5CrBQMZ7zjDeE+/AX0FpMpWk=----ATTACHMENT:----ODQwMjI2Mjk0ODk0OTA5MiA2ODQ4MzA4OTQzNTMyOTUgMTczMDgyOTUzNTU3NTAwNw==