コード例 #1
0
ファイル: HttpResponse.php プロジェクト: brickoo/components
 /**
  * Inject the dependencies from an other response.
  * @param HttpResponse $httpResponse
  * @return \Brickoo\Component\Http\HttpResponse
  */
 public function inject(HttpResponse $httpResponse)
 {
     $this->version = $httpResponse->getVersion();
     $this->status = $httpResponse->getStatus();
     $this->message = $httpResponse->getMessage();
     return $this;
 }
コード例 #2
0
ファイル: SaveResult.php プロジェクト: silviogarbes/phpodata
 /**
  * Retrive http exception from HttpResponse object.
  *
  * @param HttpResponse $httpResponse
  * @return string
  */
 protected function getHttpException($httpResponse)
 {
     $exception = '';
     $headers = $httpResponse->getHeaders();
     if (isset($headers['Content-type'])) {
         if (strpos(strtolower($headers['Content-type']), strtolower(Resource::Content_Type_ATOM)) !== FALSE) {
             $exception = $httpResponse->getMessage();
         } else {
             $exception = $httpResponse->getBody();
         }
     } else {
         $exception = $httpResponse->getMessage();
     }
     return $exception;
 }