/** * Take care of setting up the proxy (do nothing if "noProxy" is set) * * @return void */ public function proxySetup() { // If there is an explicit proxy set and proxies are not disabled, then use it if ($this->proxy && !$this->noProxy) { return; } // Otherwise, fallback to $wgHTTPProxy/http_proxy (when set) if this is not a machine // local URL and proxies are not disabled if (Http::isLocalURL($this->url) || $this->noProxy) { $this->proxy = ''; } else { $this->proxy = Http::getProxy(); } }
/** * @covers Http::getProxy */ public function testGetProxy() { $this->setMwGlobals('wgHTTPProxy', 'proxy.domain.tld'); $this->assertEquals('proxy.domain.tld', Http::getProxy()); }