/** * Sends a PUT-Request to google drive and parses the response, * setting the appropiate variables from the response() * * @param Request $httpRequest the Reuqest which will be send * * @return false|mixed false when the upload is unfinished or the decoded http response * */ private function makePutRequest(Request $httpRequest) { if ($this->client->getClassConfig("Request", "enable_gzip_for_uploads")) { $httpRequest->enableGzip(); } else { $httpRequest->disableGzip(); } $response = $this->client->getIo()->makeRequest($httpRequest); $response->setExpectedClass($this->request->getExpectedClass()); $code = $response->getResponseHttpCode(); $this->httpResultCode = $code; if (308 == $code) { // Track the amount uploaded. $range = explode('-', $response->getResponseHeader('range')); $this->progress = $range[1] + 1; // Allow for changing upload URLs. $location = $response->getResponseHeader('location'); if ($location) { $this->resumeUri = $location; } // No problems, but upload not complete. return false; } else { return REST::decodeHttpResponse($response, $this->client); } }