stream = stream_context_create($options); } /** * The response headers from the stream wrapper * * @return array */ public function getResponseHeaders() { return $this->responseHeaders; } /** * Send a stream wrapped request * * @param string $url * * @return mixed */ public function fileGetContents($url) { $rawResponse = file_get_contents($url, false, $this->stream); $this->responseHeaders = $http_response_header ?: []; return $rawResponse; } }