private function execute($url, $context)
    {
        if (($stream = @fopen($this->fixUrl($url), 'rb', false, $context)) === false) {
            throw HttpAdapterException::cannotFetchUrl($url, $this->getName(), print_r(error_get_last(), true));
        }

        $metadata = stream_get_meta_data($stream);

        if (preg_match_all('#Location:([^,]+)#', implode(',', $metadata['wrapper_data']), $matches)) {
            $effectiveUrl = trim($matches[1][count($matches[1]) - 1]);
        } else {
            $effectiveUrl = $url;
        }

        $content = stream_get_contents($stream);
        fclose($stream);

        return $this->createResponse(
            isset($metadata['wrapper_data'][0]) ? $this->parseStatusCode($metadata['wrapper_data'][0]) : null,
            $url,
            $metadata['wrapper_data'],
            $content,
            $effectiveUrl
        );
    }