src/Graviton/ProxyBundle/Definition/Loader/HttpLoader.php
private function fetchFile(RequestInterface $request)
    {
        $content = "{}";
        try {
            $response = $this->client->send($request);
            $content = (string) $response->getBody();
            if (isset($this->cache)) {
                $this->cache->save($this->options['storeKey'], $content, $this->cacheLifetime);
            }
        } catch (RequestException $e) {
            $this->logger->info(
                "Unable to fetch File!",
                [
                    "message" => $e->getMessage(),
                    "url" => $request->getRequestTarget(),
                    "code" => (!empty($e->getResponse())? $e->getResponse()->getStatusCode() : 500)
                ]
            );
        }

        return $content;
    }
private function fetchFile(RequestInterface $request)
    {
        $content = "{}";
        try {
            $response = $this->client->send($request);
            $content = (string) $response->getBody();
            if (isset($this->cache)) {
                $this->cache->save($this->options['storeKey'], $content, $this->cacheLifetime);
            }
        } catch (RequestException $e) {
            $this->logger->info(
                "Unable to fetch File!",
                [
                    "message" => $e->getMessage(),
                    "url" => $request->getRequestTarget(),
                    "code" => (!empty($e->getResponse())? $e->getResponse()->getStatusCode() : 500)
                ]
            );
        }

        return $content;
    }
private function fetchFile ( RequestInterface $ request ) { $ content = "{}" ; try { $ response = $ this -> client -> send ( $ request ) ; $ content = ( string ) $ response -> getBody ( ) ; if ( isset ( $ this -> cache ) ) { $ this -> cache -> save ( $ this -> options [ 'storeKey' ] , $ content , $ this -> cacheLifetime ) ; } } catch ( RequestException $ e ) { $ this -> logger -> info ( "Unable to fetch File!" , [ "message" => $ e -> getMessage ( ) , "url" => $ request -> getRequestTarget ( ) , "code" => ( ! empty ( $ e -> getResponse ( ) ) ? $ e -> getResponse ( ) -> getStatusCode ( ) : 500 ) ] ) ; } return $ content ; }
fetch file from remote destination

@param RequestInterface $request request

@return string
fetch file from remote destination