private function prepareContext() { $context = array('http' => array('method' => 'GET', 'protocol_version' => 1.1, 'timeout' => $this->timeout, 'max_redirects' => $this->max_redirects)); if ($this->proxy_hostname) { Logger::setMessage(get_called_class() . ' Proxy: ' . $this->proxy_hostname . ':' . $this->proxy_port); $context['http']['proxy'] = 'tcp://' . $this->proxy_hostname . ':' . $this->proxy_port; $context['http']['request_fulluri'] = true; if ($this->proxy_username) { Logger::setMessage(get_called_class() . ' Proxy credentials: Yes'); } else { Logger::setMessage(get_called_class() . ' Proxy credentials: No'); } } $context['http']['header'] = implode("\r\n", $this->prepareHeaders()); return $context; }