Пример #1
0
 public function getBody()
 {
     if (!$this->contents) {
         $contents = parent::getBody()->getContents();
         if (false !== ($content = @gzdecode($contents))) {
             $contents = $content;
         }
         $this->contents = $contents;
     }
     return $this->contents;
 }
Пример #2
0
 /**
  * @param HttpAdapterResponse $httpAdapterResponse
  *
  * @return ElasticaResponse
  */
 protected function _createElasticaResponse(HttpAdapterResponse $httpAdapterResponse)
 {
     return new ElasticaResponse((string) $httpAdapterResponse->getBody(), $httpAdapterResponse->getStatusCode());
 }